[vtkusers] Help : how memory is used with VTK ?
Amy Squillacote
amy.squillacote at kitware.com
Fri Apr 28 11:40:40 EDT 2006
Hi Nicolas,
You could try experimenting with the ReleaseDataFlag in vtkDataObject
and vtkAlgorithm. The methods in both classes are called
ReleaseDataFlagOn and ReleaseDataFlagOff.
- Amy
At 10:58 AM 4/28/2006, Nicolas Cathaud wrote:
>Hi Amy,
>
>Thank you for your answer !
>
>What I want to do it's to manage a scene with a lot of actors, and
>if I don't free memory when I hide an actor, it can be a big
>problem. Indeed, I will have a lot of memory reserved but don't
>used. The only way I find to free this memory is closing the
>vtkRenderWindow, which is not a great solution... If I remove the
>actor or if I delete it, the memory is not freed.
>
>I don't mind if I need to re-read data or re-execute filters.
>
>Moreover, I notice that the memory is freed if I delete the
>vtkRenderWindow, and if I re-open it there are no compute, the
>display is immediate. So I don't understand why there's a lot of
>memory used even if my actor is hide. Can you explain that ?
>
>Regards
>
>Nicolas Cathaud
>
>2006/4/27, Amy Squillacote
><<mailto:amy.squillacote at kitware.com>amy.squillacote at kitware.com>:
>Hi Nicolas,
>
>Assuming that you're saying you see a memory increase just before VTK
>first renders your model, then the reason is VTK's demand-driven
>pipeline. VTK does not read data, run filters, etc. until something
>tells it to (rendering, in your case).
>
>This should also explain why the memory isn't freed when you hide
>part of your scene; memory was allocated when these parts of your
>scene were first rendered, and if the memory was freed just because
>you weren't rendering that part of the scene, then data would have to
>be re-read, filters re-executed, etc. when you wanted to render that
>part of the scene again.
>
>- Amy
>
>At 11:31 AM 4/27/2006, Nicolas Cathaud wrote:
> >Hello everybody,
> >
> >I have many questions about vtk and memory. When I load a big model with VTK
> >(nearly 300.000 triangles), I notice that the memory clearly increases just
> >before display. I just want to know if it's possible to avoid this, even if
> >I lose in movement's fluidity. I can't find what consume this memory, and
> >I'm curious to know the reason of that. Is it an openGL mode which allocate
> >a lot of memory in order to increase the performance ? Is it the data
> >structure of vtk ?
> >
> >My second question is how to free this memory when I want to hide an element
> >of the scene. Indeed, I have many actors in my scene, and I want to have the
> >possibility to hide or show this actors, so I use the commands "AddActor"
> >and "RemoveActor", but it didn't free the memory when there are no actor in
> >the scene.
> >
> >Thank you for reading this message.
> >
> >Regards.
> >
> >Nicolas CATHAUD
> >
> >
> >
> >_______________________________________________
> >This is the private VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >Follow this link to subscribe/unsubscribe:
> ><http://www.vtk.org/mailman/listinfo/vtkusers>http://www.vtk.org/ma
> ilman/listinfo/vtkusers
>
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the 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/20060428/b2b8bbb3/attachment.htm>
More information about the vtkusers
mailing list