[vtkusers] Delete actor and release memory

Nicolas Rannou nicolas.lists at gmail.com
Tue Jul 5 09:30:17 EDT 2011


Yes I enabled vtkDebugLeaks and it seems that everything is fine.

You can find the example I was playing with at:
git at github.com:NicolasRannou/spheres.git

Thanks


Nicolas


On Tue, Jul 5, 2011 at 9:17 AM, Sebastien Jourdain <
sebastien.jourdain at kitware.com> wrote:

> Oups, I see...
>
> When you enable debug leaks, when the application quit, do you see any leak
> ?
>
> By now I have no clue on what is going on.
>
> Seb
>
> On Tue, Jul 5, 2011 at 9:10 AM, Nicolas Rannou <nicolas.lists at gmail.com>
> wrote:
> > 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
> >> >
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110705/3290d098/attachment.htm>


More information about the vtkusers mailing list