memory leak in vtkHyperStreamline

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

memory leak in vtkHyperStreamline

Lauren O'Donnell
Hi all,

I have found a memory leak in vtkHyperStreamline.  The internal object
this->Streamers is allocated via new each time Execute is called, however it is
only deleted when the object itself is deleted.  So if the vtkHyperStreamline
object executes multiple times there is a leak, and also keeping even one copy
of the Streamers around is very very memory intensive for some reason.

The attached script demonstrates the problem (you need to run top or similar at
the same time and see how much memory is used).  There are some lines in the
script that you can uncomment to demonstrate the leak. I found that adding these
lines to the end of the function vtkHyperStreamline::Execute() will fix the
problem (must be after the call to BuildTube):

  delete [] this->Streamers;
  this->Streamers = 0;

Thanks for looking into this!

Lauren O'Donnell


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

testVtkHyperStreamlineMemoryUse.tcl (2K) Download Attachment