[vtkusers] Delete actor and release memory

Xiaofeng Z xf10036 at hotmail.com
Tue Jul 5 18:28:17 EDT 2011


Does the memory location pointed by variable actor still contain a valid object (e.g. reference count > 0) after actor->Delete()?  If not, then memory used by actor should have been released.

xz

From: Nicolas Rannou 
Sent: Tuesday, July 05, 2011 9:10 AM
To: Sebastien Jourdain 
Cc: vtkusers at public.kitware.com 
Subject: Re: [vtkusers] Delete actor and release memory

Hi Sebastien, 

Yes, I don't delete it on purpose. 

I would like to keep the polydata in memory but delete everything else which is related to the visualization in order to decrease the memory usage!

Thanks

Nicolas

On Sat, Jul 2, 2011 at 11:19 PM, Sebastien Jourdain <sebastien.jourdain at kitware.com> wrote:

  You never deleted the sphere.


  On Tue, Jun 28, 2011 at 5:56 PM, Nicolas Rannou <nicolas.lists at gmail.com> wrote:
  > Hi all,
  > I would like to delete/remove actors from my rendering window to free
  > memory.
  > The issue is that the memory usage doesn't decrease after removing/deleting
  > the actors.
  > From my understanding, both following pseudo-codes should use the same
  > amount of memory.
  > But,
  > The first one uses: 15 Mb for 1000 spheres:
  > The second uses: 90 Mb for 1000 spheres:
  > How should I proceed in the 2nd case, to get back to the "original" memory
  > usage without actor?
  > Thanks,
  >
  > Nicolas
  > ______________________________
  > 15 Mb
  > ______________________________
  > //Create a sphere
  > vtkSphereSource* sphere = new ...
  > ______________________________
  > 90 Mb
  > ______________________________
  > //Create sphere
  > vtkSphereSource* sphere = new ...
  > // mapper
  > vtkMapper* mapper ...
  > mapper->SetInput( sphere->GetOutput() )
  > // actor
  > vtkActor* actor...
  > actor->SetMapper(mapper)
  > mapper->Delete()
  > // Add and remove actor
  > renderer->AddActor(actor)
  > renderer->RemoveActor(actor)
  > // Delete actor
  > actor->Delete()
  > ______________________________
  > ______________________________
  >
  >

  > _______________________________________________
  > 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
  >
  >




--------------------------------------------------------------------------------
_______________________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110705/11210104/attachment.htm>


More information about the vtkusers mailing list