[vtkusers] Delete actor and release memory

Sebastien Jourdain sebastien.jourdain at kitware.com
Sat Jul 2 23:19:31 EDT 2011


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



More information about the vtkusers mailing list