I am facing a Java process memory issue where:
* heap usage never rises above 2.2 GB, with 11 GB allocated
* garbage collection cleans up heap as expected
* non-heap hovers around 300 MB
* total process memory usage is greater than 60 GB
How is it that the process memory usage can be greater than the total allocated heap + non-heap memory? Can I use YourKit to identify the source of this issue?
Total Process Memory > Heap + Non-Heap
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Total Process Memory > Heap + Non-Heap
JVM may reserve more memory pages than shown as allocated heap. This likely depends on the OS and Java version.
What are the -Xmx/-Xms settings? Please try setting smaller heap limits.
What are the -Xmx/-Xms settings? Please try setting smaller heap limits.
-
- Posts: 2
- Joined: Sat Apr 14, 2018 3:20 am
Re: Total Process Memory > Heap + Non-Heap
To clarify:
* I am running OpenJDK 8 on Linux.
* -Xmx12000M
* Total process memory usage gradually increases over time to reach 60 GB, but heap + non-heap never exceeds 2.2 GB. So it is not that the process allocates 60 GB from the start, this happens gradually.
* I am running OpenJDK 8 on Linux.
* -Xmx12000M
* Total process memory usage gradually increases over time to reach 60 GB, but heap + non-heap never exceeds 2.2 GB. So it is not that the process allocates 60 GB from the start, this happens gradually.
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Total Process Memory > Heap + Non-Heap
How do you measure the total process memory usage: by using corresponding graph in the profiling results or with a Linux command/tool?
Do you use any 3rd party native libraries? It is possible that the memory allocation happens in native code.
Does you application use memory mapped buffers (Java NIO)?
Could you please send to [email protected] the snapshot (a download link) of the application.
Do you use any 3rd party native libraries? It is possible that the memory allocation happens in native code.
Does you application use memory mapped buffers (Java NIO)?
Could you please send to [email protected] the snapshot (a download link) of the application.