Reputation: 348
What are the possible causes for when the Linux top command shows a Java process is using 14GBs of memory while Java profiling shows only 2GBs being used?
Upvotes: 2
Views: 1432
Reputation: 2934
Your total memory is a result heap, PermSize and Stack size.
Max memory = [-Xmx] + [-XX:MaxPermSize] + number_of_threads * [-Xss]
Besides this JVM would also need some space to run smoothly. Explained here in deatil
Upvotes: 1
Reputation: 718886
That means that your JVM / Java application is using off-heap memory. Lots of it.
malloc
). It might be a memory leak of some kind, but it is not a memory leak of heap objects.
(The theory that it is due to -Xms is probably wrong. If the JVM preallocated a huge initial heap and didn't use it, you wouldn't expect that much "RES" memory. It is conceivable that the heap has gotten really big and has down-sized, but the JVM hasn't (yet) given the space back to the OS. But AFAIK the JVM releases the memory back to the OS when it downsizes the heap.)
If you are going to get to the bottom of this, you will need to understand what your application, and its library dependencies are doing.
Upvotes: 5