[osg-users] Why ref_ptr node can not release memory immediatelly?

61 views
Skip to first unread message

John Lee

unread,
Jul 8, 2016, 1:32:16 AM7/8/16
to osg-...@lists.openscenegraph.org
Hi,

In my appllication, there are many child nodes in my root node. When i dynamically remove its child node, i find the memory will not free immediatelly, it will free sometimes, maybe it will free when i keep removing a few child nodes, or it will free when i remove all child nodes? Why this happens? And can anyone tell me how to free the scene memory immediatelly?

Thank you!

Cheers,
John

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68047#68047





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Alberto Luaces

unread,
Jul 8, 2016, 3:03:33 AM7/8/16
to osg-...@lists.openscenegraph.org
Hi John,

there was a recent discussion on the topic that may be interesting to
you:

http://forum.openscenegraph.org/viewtopic.php?t=15809

"John Lee" <3570...@qq.com> writes:

> Hi,
>
> In my appllication, there are many child nodes in my root node. When i
> dynamically remove its child node, i find the memory will not free
> immediatelly, it will free sometimes, maybe it will free when i keep
> removing a few child nodes, or it will free when i remove all child
> nodes? Why this happens? And can anyone tell me how to free the scene
> memory immediatelly?
>
> Thank you!

--
Alberto

John Lee

unread,
Jul 8, 2016, 4:01:11 AM7/8/16
to osg-...@lists.openscenegraph.org
Hi,Alberto
Thank you for your reply.
The problem at the link you share is exactly what i have now. But I can't find any solution on it. The memory usage is based on windows task manager.

John


Alberto Luaces wrote:
> Hi John,
>
> there was a recent discussion on the topic that may be interesting to
> you:
>
> http://forum.openscenegraph.org/viewtopic.php?t=15809
>
> "John Lee" <> writes:
>
>
> > Hi,
> >
> > In my appllication, there are many child nodes in my root node. When i
> > dynamically remove its child node, i find the memory will not free
> > immediatelly, it will free sometimes, maybe it will free when i keep
> > removing a few child nodes, or it will free when i remove all child
> > nodes? Why this happens? And can anyone tell me how to free the scene
> > memory immediatelly?
> >
> > Thank you!
> >
>
> --
> Alberto
>
> _______________________________________________
> osg-users mailing list
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68052#68052

Sebastian Messerschmidt

unread,
Jul 8, 2016, 4:12:17 AM7/8/16
to osg-...@lists.openscenegraph.org
Am 08.07.2016 um 10:10 schrieb John Lee:
> Hi,Alberto
> Thank you for your reply.
> The problem at the link you share is exactly what i have now. But I can't find any solution on it. The memory usage is based on windows task manager.
There is no "problem".
1. ) The driver will release the freed memory when it is appropriate.
2.) Relying on the "working set" displayed in the task-manager is hardly
an indication on how much memory is used.
3.) Some data might be shared between nodes (e.g. images), so they can
be removed only if the last reference is gone.


The question is: If you're hitting a memory limit somewhere, than you
might be doing something wrong. This include not using the
reference-counting system correctly or simply cloning data where it
should be shared.
Cheers
Sebastian

P.S.
Also see:

http://forum.openscenegraph.org/viewtopic.php?p=43571#43571

John Lee

unread,
Jul 8, 2016, 6:36:05 AM7/8/16
to osg-...@lists.openscenegraph.org
Hi,Sebastian
Thank you for your reply!

John
> > > > Hi,
> > > >
> > > > In my appllication, there are many child nodes in my root node. When i
> > > > dynamically remove its child node, i find the memory will not free
> > > > immediatelly, it will free sometimes, maybe it will free when i keep
> > > > removing a few child nodes, or it will free when i remove all child
> > > > nodes? Why this happens? And can anyone tell me how to free the scene
> > > > memory immediatelly?
> > > >
> > > > Thank you!
> > > >
> > > >
> > > --
> > > Alberto
> > >
> > > _______________________________________________
> > > osg-users mailing list
> > >
> > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > >
> > > ------------------
> > > Post generated by Mail2Forum
> > >
> >
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=68052#68052
> >
> >
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> >
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
>
>
> _______________________________________________
> osg-users mailing list
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68060#68060
Reply all
Reply to author
Forward
0 new messages