[vtkusers] VTK Java memory leak

James Labiak jim at jslengineeringsoftware.com
Wed Feb 11 10:02:14 EST 2015


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


More information about the vtkusers mailing list