[vtkusers] VTK Java memory leak

David E DeMarle dave.demarle at kitware.com
Wed Feb 11 10:31:09 EST 2015


On quick suggestion configure vtk to have VTK_DEBUG_LEAKS on (on the
advanced set of cmake options) and rebuild.

Then when you exit the program it will tell you what VTK instances have not
been entirely dereferences and thus not yet deallocated.

That should help narrow it down.


David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Wed, Feb 11, 2015 at 10: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/c8aec28b/attachment.html>


More information about the vtkusers mailing list