[vtk-developers] Query about vtkDebugLeaks
Deepak Surti
dmsurti at gmail.com
Mon Jan 26 02:03:22 EST 2015
Hi,
I am using vtkDebugLeaks. Using this example here:
http://www.vtk.org/Wiki/VTK/Examples/Python/DataManipulation/Cube.py,
if I *insert
this line* : (after lines 10 and 82 in main function):
vtk.vtkDebugLeaks.PrintMemoryLeaks()
when, I run the script, I get the following on the console:
vtkDebugLeaks has detected LEAKS!
Class "vtkObjectFactoryCollection" has 1 instance still around.
Class "vtkBoxMuellerRandomSequence" has 1 instance still around.
Class "vtkMinimalStandardRandomSequence" has 1 instance still around.
vtkDebugLeaks has detected LEAKS!
Class "vtkObjectFactoryCollection" has 1 instance still around.
Class "vtkBoxMuellerRandomSequence" has 1 instance still around.
Class "vtkMinimalStandardRandomSequence" has 1 instance still around.
If I comment out all the del <python_obj> lines in the script, obviously I
get a whole lot of memory leaks detected, as expected.
My question is about the 3 leaks detected as in the trace above, with all
the del <python_obj> in place.
Are these 3 not leaks, but reports created by static initializers (as
mentioned by David E DMarie here:
http://vtk.1045678.n5.nabble.com/vtkDebugLeaks-problems-td5594643.html).
Also, if I write a test case to ensure no memory leaks are reported, I
cannot use the test: vtk.vtkDebugLeaks.PrintCurrentLeaks() == 0. Or if the
above are indeed not leaks, but only reports, will
vtk.vtkDebugLeaks.PrintCurrentLeaks() == 1 be a reliable test case?
I have attached 2 python scripts for reference, cube.py (with
vtk.vtkDebugLeaks and del <<python_object>> statements in place) and
cube_mem_leaks.py (vtk.vtkDebugLeaks and del <<python_object>> statements
removed.)
Thanks,
Deepak
--
http://deepaksurti.com
To see a miracle, be the miracle.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150126/f3d739a1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cube_mem_leaks.py
Type: text/x-python-script
Size: 2215 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150126/f3d739a1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cube.py
Type: text/x-python-script
Size: 2314 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150126/f3d739a1/attachment-0001.bin>
More information about the vtk-developers
mailing list