<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Am 13.05.2016 um 17:28 schrieb Bruno
Oliveira:<br>
</div>
<blockquote
cite="mid:CAO-SbSuKy5OH4e54R4MXsaeaRt6_AuUa7OB1Tp-MFES3ox_oLQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>I checked with valgrind, and effectively I did not find
any memory leak.<br>
</div>
<br>
</div>
The OS System Monitor (Ubuntu, as I said) consistently
presents double the memory valgrind does (e.g., System Monitor
says the app is using 2Gb, while valgrind states it is 1GB).<br>
<br>
</div>
My data (a point cloud) is actually 1GB (binary format). I
thought the 2GB came from OSG or OpenGL driver keeping a copy of
my data for some reason.<br>
</div>
</blockquote>
Yes, because it is totally up to the driver to release this memory.
This should not worry, since this memory is not lost or anything. It
is simply reserved by the driver for possible future allocations and
it will be swapped by the OS if not used.<br>
I haven't seen any problems wiht OSG's memory use so far if the
reference pointers are used in the correct way. <br>
<br>
Cheers<br>
Sebastian <br>
<br>
<blockquote
cite="mid:CAO-SbSuKy5OH4e54R4MXsaeaRt6_AuUa7OB1Tp-MFES3ox_oLQ@mail.gmail.com"
type="cite">
<div class="gmail_extra"><br>
<div class="gmail_quote">2016-05-13 16:23 GMT+01:00 Alberto
Luaces <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:aluaces@udc.es" target="_blank">aluaces@udc.es</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">I think
some facts must be made clear:<br>
<br>
* You cannot control when the OpenGL driver releases the
memory it<br>
claimed in a previous instant.<br>
<br>
* You cannot control when the operating system claims back
the memory<br>
pages that a process requested, and in addition, many
times it is<br>
simply not possible to do it due to memory fragmentation.<br>
<br>
* At most, what you can do is to check that your program is
not leaking<br>
memory with a special tool, as the one I recommended
(valgrind for<br>
CPUs, other tools for GPUs).<br>
<br>
System memory tools are completely unreliable for this
specific purpose.<br>
<div class="HOEnZb">
<div class="h5"><br>
Bruno Oliveira writes:<br>
<br>
> I tried removing the children with
m_rootNode->removeChildren(0,<br>
> m_rootNode->getNumChildren());<br>
> but this results in some memory being still
allocated.<br>
><br>
> After that, I move the mouse around a bit in the
clean scene, and the<br>
> memory starts being freed. However, It never gets
to the initial<br>
> value, there is always some memory floating around.<br>
><br>
> 2016-05-13 15:16 GMT+01:00 Alberto Luaces<br>
> <<a moz-do-not-send="true"
href="mailto:aluaces@udc.es">aluaces@udc.es</a>>:<br>
><br>
> Bruno,<br>
><br>
> if you read the source code, you will see that
the LOD uses the<br>
> same<br>
> scheme for storing nodes as a Group: just a
vector of ref_ptr that<br>
> will<br>
> be unallocated when destroyed.<br>
><br>
> Maybe you can place some breakpoints at the
destructors on the<br>
> debugger<br>
> and see what is happening.<br>
><br>
> Bruno Oliveira writes:<br>
><br>
> > Thank you for your answer. However, since
I'm using a LOD, I<br>
> think it<br>
> > is not properly removing my data. At least
the memory is still<br>
> > allocated.<br>
> > If I manually iterate over all nodes and
delete them by myself,<br>
> some<br>
> > memory is freed, but not all!<br>
> ><br>
> > 2016-05-13 14:58 GMT+01:00 Alberto Luaces<br>
> ><br>
> ><br>
><br>
><br>
> > Bruno Oliveira writes:<br>
> ><br>
> > > At some point I want to completely
wipe out my scene. How can<br>
> I<br>
> > delete<br>
> > > all nodes?<br>
> ><br>
> > If you want to wipe a node and all its
descendants, just delete<br>
> > the<br>
> > parent node. That is what reference
counting is all about.<br>
><br>
> --<br>
> Alberto<br>
><br>
> _______________________________________________<br>
> osg-users mailing list<br>
> <a moz-do-not-send="true"
href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
> <a moz-do-not-send="true"
href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org"
rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
><br>
><br>
><br>
><br>
<br>
--<br>
Alberto<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a moz-do-not-send="true"
href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org"
rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>