<div dir="ltr">Please ignore this question: <div><span style="font-size:13px"><br></span></div><div><i><span style="font-size:13px">Also, if I write a test case to ensure no memory leaks are reported, I cannot use the test: vtk.vtkDebugLeaks.</span><span style="font-size:13px">PrintCurrentLeaks() == 0. Or if the above are indeed not leaks, but only reports, will vtk.vtkDebugLeaks.</span>PrintCurrentLeaks() == 1 be a reliable test case? </i><div><br></div><div>I read the vtkDebugLeaks docs and obviously it runs non-zero if there were leaks, I was thinking it prints number of leaks detected. Anyways, in that case, how do I write a test to ensure no leaks are happening?<div><br></div><div>Thanks,</div><div>Deepak</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 26, 2015 at 12:33 PM, Deepak Surti <span dir="ltr"><<a href="mailto:dmsurti@gmail.com" target="_blank">dmsurti@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 dir="ltr">Hi,<div><br></div><div>I am using vtkDebugLeaks. Using this example here: <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/DataManipulation/Cube.py" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Python/DataManipulation/Cube.py</a>, if I <b>insert this line</b> : (after lines 10 and 82 in main function):</div><div><br></div><div>vtk.vtkDebugLeaks.PrintMemoryLeaks()</div><div><br></div><div>when, I run the script, I get the following on the console:</div><div><br></div><div><div>vtkDebugLeaks has detected LEAKS!</div><div>Class "vtkObjectFactoryCollection" has 1 instance still around.</div><div>Class "vtkBoxMuellerRandomSequence" has 1 instance still around.</div><div>Class "vtkMinimalStandardRandomSequence" has 1 instance still around.</div><div><br></div><div>vtkDebugLeaks has detected LEAKS!</div><div>Class "vtkObjectFactoryCollection" has 1 instance still around.</div><div>Class "vtkBoxMuellerRandomSequence" has 1 instance still around.</div><div>Class "vtkMinimalStandardRandomSequence" has 1 instance still around.</div><div><br></div><div>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.</div><div><br></div><div>My question is about the 3 leaks detected as in the trace above, with all the del <python_obj> in place. </div><div><br></div><div>Are these 3 not leaks, but reports created by static initializers (as mentioned by David E DMarie here: <a href="http://vtk.1045678.n5.nabble.com/vtkDebugLeaks-problems-td5594643.html" target="_blank">http://vtk.1045678.n5.nabble.com/vtkDebugLeaks-problems-td5594643.html</a>).</div><div><br></div><div>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?</div><div><br></div><div>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.)</div><div><br></div><div>Thanks,</div><div>Deepak</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><a href="http://deepaksurti.com" target="_blank">http://deepaksurti.com</a><br>To see a miracle, be the miracle.</div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><a href="http://deepaksurti.com" target="_blank">http://deepaksurti.com</a><br>To see a miracle, be the miracle.</div>
</div>