[vtkusers] Delete actor and release memory

Nicolas Rannou nicolas.lists at gmail.com
Tue Jun 28 17:56:55 EDT 2011


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()
______________________________
______________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110628/a79c92ad/attachment.htm>


More information about the vtkusers mailing list