<br><br><div class="gmail_quote">On Wed, Jul 6, 2011 at 4:06 PM, John Drescher <span dir="ltr"><<a href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Jul 6, 2011 at 3:56 PM, Nicolas Rannou <<a href="mailto:nicolas.lists@gmail.com">nicolas.lists@gmail.com</a>> wrote:<br>
><br>
><br>
> On Wed, Jul 6, 2011 at 3:43 PM, John Drescher <<a href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>> wrote:<br>
>><br>
>> On Wed, Jul 6, 2011 at 10:35 AM, Xiaofeng Z <<a href="mailto:xf10036@hotmail.com">xf10036@hotmail.com</a>> wrote:<br>
>> > That's interesting, and quite unintuitive! maybe someone with better<br>
>> > understanding of VTK's inner work can offer an explanation!<br>
>> ><br>
>><br>
>> To me this looks like garbage being left over after the object was<br>
>> deleted. You need to look at the reference counts before the delete<br>
>> not after.<br>
>><br>
>> John<br>
><br>
> How could I avoid garbage being left over?<br>
<br>
</div>What I mean is after the Delete if the object was really deleted the<br>
reference counts could be not trusted because the memory holding the<br>
reference counts would be freed. I would trace through the code to see<br>
what exactly is happening.<br>
<font color="#888888"><br>
John<br>
</font></blockquote></div><br><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><div>
Ok I see what you mean now.</div><div><br></div><div>I'll try to debug it step by step and see what is happening...</div><div><br></div><div>I used to rely on the system monitor to get a gross approximation of the memory usage but it looks like it is quite not reliable.</div>
<div><br></div><div>I debugged my program with massif (<a href="http://valgrind.org/docs/manual/ms-manual.html" target="_blank" style="color: rgb(0, 0, 0); ">http://valgrind.org/docs/manual/ms-manual.html</a>) and the memory usage looks fine.</div>
<div>(the memory usage decreases significantly after deleting actors, mappers and polydatas)</div><div><br></div><div>A surprising thing is that, if I run my program with this heap profiler tool, the ref counts of the polydatas, mappers and actors are "accurate" (==0) after deleting the objects. The same program without the heap profiler returns weird ref counts after deleting the objects.</div>
<div><br></div><div>I'm wondering if the memory usage looks fine into massif because the ref counts are corrects (==0) or if the system monitor is just wrong and the ref counts don't really matter.</div><div>In other words, if I get ref counts == 0 in my program (without heap profiler), would I be able to see the memory usage decrease in the system monitor?</div>
<div><br></div><div>Thanks</div></span></div>