<div dir="ltr">Josh,<div><br></div><div>I am sending you a patch is a separate email. Just to summarize for the list:</div><div><br></div><div style>- When writing plugins/readers, turn on CMake flag VTK_DEBUG_LEAKS. ParaView will start dumping messages about any VTK objects that are not cleaned up while exiting the application. That helps to catch stray VTK-object references early in the development process.</div>
<div style><br></div><div style>- Use vtkNew<> for creating local VTK objects in methods. Developers often forget to call the Delete() before exiting the method esp. when complicated if/else/swicthes are involved.</div>
<div style><br></div><div style>- Use vtkSmartPointer<> or vtkWeakPointer<> when storing vtkObjects in STL maps/list. Makes memory management a lot easier.</div><div style><br></div><div style>Utkarsh</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 22, 2013 at 3:27 PM, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Josh,<div><br></div><div>VTK/ParaView uses reference counting. So as long as a there's a reference held to any dataobject, Delete() is not going to release it. Barring cycles, a quick way to see if Delete() will result in clearing the object, is to look it it's ReferenceCount member variable before calling Delete(). However if you're passing the data allocated as output from your filters then the reference maybe getting held by the pipeline beyond your control. If you can share the code, I can see if I can explain why the memory may not be getting released.</div>
<div><br></div><div>Utkarsh</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Fri, Feb 22, 2013 at 12:22 PM, Joshua Murphy <span dir="ltr"><<a href="mailto:Joshua.Murphy@lasp.colorado.edu" target="_blank">Joshua.Murphy@lasp.colorado.edu</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word"><div>Hello,</div><div><br></div><div>I am writing a cache system for my reader, and I am trying to figure out how to force a garbage collection after I dump my cache.</div>
<div><br></div><div>Does anyone know how to force ParaView to collect garbage? Currently after I purge my cache (I am calling Delete() on all of the objects and destroying the remainder of the cache map) the system memory does not free up… ParaView remains in control of all of the memory for the dumped cache items, and when the new cache is introduced, the memory usage just keeps going up.</div>
<div><br></div><div>I suppose it is possible that I am missing some fundamental understanding of how ParaView and VTK manage memory, so if someone could help that would be great.</div><div><br></div><div><br></div><div>Thanks,</div>
<div><br></div><div>Josh</div><div><br></div><div><div><div><div><img src="cid:91A5C34F-7843-4C4C-B168-D86C6C78592E" type="image/png"></div></div><div>Joshua J. Murphy</div><div>Computer Scientist</div><div>Laboratory for Atmospheric and Space Physics</div>
<div>University of Colorado, Boulder</div><div><br></div></div></div></div>
<br></div></div>_______________________________________________<br>
Paraview-developers mailing list<br>
<a href="mailto:Paraview-developers@paraview.org" target="_blank">Paraview-developers@paraview.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" target="_blank">http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>