How to detect memory leak in a Java application outside the heap?

We have a Java application that uses SWT and some other DLLs through JNA in a Windows 7 environment.

We have seen that the memory usage of the JVM process increases over time, but the heap of JVMs is relatively stable under normal GC activity.

We suspect that there is a memory leak from the SWT and / or JNA / DLL, but cannot be sure why and where.

Are there any tools on the Windows platform that can help detect such a problem? Or any tool on the Java platform that can help solve this problem? Any suggestion is welcome.

+4
source share
1 answer

Java 8 has a command line switch: -XX:NativeMemoryTracking=<value> , where the value can be off , summary or detail .

You can set this to detail , and then you can query it with jcmd .

There is official documentation on this here . However, this feature is quite limited, but can help find the cause.


Otherwise, a rough but effective way to identify the source of the problem is to replace the DLL with a dummy version (or even a non-native dummy) and see if you can reproduce the same problem.

+2
source

All Articles