[vtkusers] VTK Java memory leak

Sebastien Jourdain sebastien.jourdain at kitware.com
Wed Feb 11 10:34:28 EST 2015


Hi Jim,

If you look at the sample code provided inside the VTK source code, you
will notice how to use the VTK garbage collector.
(${VTK_SRC}/Wrapping/Java/vtk/sample/Demo.java)

Seb

On Wed, Feb 11, 2015 at 8:02 AM, James Labiak <
jim at jslengineeringsoftware.com> wrote:

> I have a Java GUI application which runs without memory leaks. It loads a
> database of simulations and displays 2D graphs for output. I added VTK code
> so that I can also display 3D graphs. Now, when I repeatedly display/cycle
> through the the same 4 VTK graphs (or different graphs) many times, the
> program uses increasing memory until the computer runs out of RAM and the
> application fails to respond. It seems to have a memory leak related to
> VTK. Memory is only freed when I then kill the application process. I have
> searched for information on this and tried to address various potential
> issues without success. In version 6.0, the VTK garbage collection method
> seems to have been removed. I think that I addressed potential reference
> count issues by providing VTK object references that go through the Java
> object layer. I tried adding code to delete VTK objects manually through
> someVTKObject.Delete() but that didn't seem to help. I ran jvisualvm but
> haven't been able to identify what is causing the leak. I am relatively new
> to VTK (and jvisualvm), so I wonder if there is a general strategy to
> address the memory leak issue, or other potential issues that I should look
> for.
> Thanks,
> Jim
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150211/5ab27158/attachment.html>


More information about the vtkusers mailing list