[vtkusers] Missing classes

David Gobbi david.gobbi at gmail.com
Tue Jan 19 13:42:40 EST 2010


Hi Jothy,

When python objects aren't released from memory, it's usually because
they are in the global scope.  For example, if you do this:

  o = vtkObject()

then the object will still be in memory when the program exits, but if
you do this:

  def main():
    o = vtkObject()

  main()

then the object is released when the function exits.  Do you see the difference?

Python doesn't release objects that are in the global scope because
the operating system will automatically release all the memory when
the process exits.  Having python go through these objects one-by-one
would slow down the exit without providing any real benefit.  However,
memory leak detectors will see these objects and report them.

  David


On Tue, Jan 19, 2010 at 11:19 AM, KS Jothybasu <jothybasu at gmail.com> wrote:
> Thanks David,
>
> I have checked the source code of vtk 5.4.2, I did not find the
> vtkPolydataSilhoute.So, that should be in the latest CVS. I will give it a
> try.
>
> Automatic garbage collection is another advantage of python. But, in C++ you
> don't need to call the Delete(), if you use smartpointers. But, in python
> with auto garbage collection why I get memory leaks after exiting the
> application ( my renderwindow has some graphics on the screen even without
> doing any rendering).
>
> Thanks
>
> Jothy
>
> (I am sorry, I don't know how it has gone to your personal ID, clicking the
> wrong button it seems!)
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list