<br><div>If vtkdebugleaks passes, it means that no vtk objects are left. It doesn't say anything about you own buffers and data structures.<span></span></div><div>Run it through valgrind to find out what <span class="Apple-style-span" style>non vtk references are not freed.</span></div>
<div></div><div><br>On Saturday, October 6, 2012, cel02000 wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear All,<br>
<br>
I have developed a VTK code for my Ph.D thesis since 8 months ago. It is now<br>
about 7000 lines. At the beginning, I had a problem in passing<br>
vtkSmartPointer to functions. I posted my question here and was advised not<br>
to use vtkSmartPointer and instead use c++ pointer as function arguments.<br>
Everything worked really well by not using vtkSmartPointer as a function<br>
argument and I did not encounter any problem. Now after 8 months, I have<br>
developed all parts of the code for my thesis. It is working fine. However,<br>
I noticed that my code has severely bad memory leak.<br>
<br>
In the code, I have to loop the main function 10 times. When I look at<br>
Windows Task Manager, I notice that the memory increases from 3GB to 47GB. I<br>
have deleted all the created VTK instances using ->Delete(). I also used<br>
vtkDebugLeaks to see if I have memory leak. It did not report any memory<br>
leak. I searched and found a post that we should use vtkSmartPointer to<br>
avoid memory leaks. I am now confused. I would be very grateful if someone<br>
could help me how I can fix the memory leak in my code. Am I able to solve<br>
the memory leak with minimal changes to my code? Or I should fundamentally<br>
modify it.<br>
<br>
Regards,<br>
Ahmad<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/To-use-vtkSmartPointer-or-not-use-Memory-Leak-tp5716501.html" target="_blank">http://vtk.1045678.n5.nabble.com/To-use-vtkSmartPointer-or-not-use-Memory-Leak-tp5716501.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div>
<br><br>-- <br>David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909<br>