[vtkusers] JVM Crashes while Call vtkGlobalJavaHash.DeleteAll() in Ubuntu...
Sebastien Jourdain
sebastien.jourdain at kitware.com
Tue May 10 07:49:21 EDT 2011
Hi Sathish,
to free most of the memory you should remove the actor that you put
inside the renderer. By doing that you will allow the whole pipeline
to be released.
And if this is crashing on linux because no more actor are present in
the renderer, you can simply add a dummy text actor before removing
your actor.
Seb
On Tue, May 10, 2011 at 4:38 AM, Sathish Kumar <kingvsk at aol.com> wrote:
> Hi Sebastien,
>
> Thank you so much. I tried your suggestions. It works without crash in
> linux.
> Check the following code.
>
> private void formWindowClosed(java.awt.event.WindowEvent evt)
> {
> // CGarbage Collection...
>
> // vpanAxial.GetRenderer().RemoveAllViewProps();
> // vpanAxial.GetRenderer().RemoveAllLights();
> //
> vpanAxial.GetRenderWindow().RemoveRenderer(vpanAxial.GetRenderer());
> vpanAxial = null;
> // vpanCoronal.GetRenderer().RemoveAllViewProps();
> // vpanCoronal.GetRenderer().RemoveAllLights();
> //
> vpanCoronal.GetRenderWindow().RemoveRenderer(vpanCoronal.GetRenderer());
> vpanCoronal = null;
> // vpanSagittal.GetRenderer().RemoveAllViewProps();
> // vpanSagittal.GetRenderer().RemoveAllLights();
> //
> vpanSagittal.GetRenderWindow().RemoveRenderer(vpanSagittal.GetRenderer());
> vpanSagittal = null;
>
> resliceAxial = null;
> resliceCoronal = null;
> resliceSagittal = null;
> actorAxial = null;
> actorCoronal = null;
> actorSagittal = null;
> reader = null;
>
> System.gc();
> vtkGlobalJavaHash.GC();
>
> }
>
> This code have 60% of memory leak. So here we have to concentrate only on
> memory leak...
>
>
> Thanks,
> Sathish
>
More information about the vtkusers
mailing list