My application has a bunch of 128 MB, but uses 1.6 GB of RAM. How can I find out where the 1.4 GB go?

In the linux platform My, a jboss java application has a bunch of 128 MB, but uses 1.6 GB of real RAM. How can I find out where the 1.4 GB go?

PID USER PR NI VIRT RES SHR S %CPU %MEM CODE DATA TIME+ COMMAND 1379 root 16 0 9.7g 1.6g 1980 S 0.7 1.3 36 9.7g 0:11.03 java 

thanks,
Emre

+4
source share
4 answers

My first step would be to learn the process in a memory profiler like VisualVM or YourKit . This can give quite a bit of initial understanding of what is actually going on using your process memory.

Another tool that can be helpful in resolving such issues is jmap .

+1
source

I do not know how you will find out. But my theory is that your application displays a huge file as a MemoryMappedBuffer . The statistics for your question indicate that you are using 9.7 gigabytes of address space.

+1
source

What do you mean by "my application has a bunch of 128 MB", you start JBoss with -Xmx 128M?

In any case, the heap size does not determine the amount of memory that your process is using; the JVM will allocate memory for other things, including the stack for each thread.

But in your case, this is probably not an explanation, because 1.4GB seems huge. Are you doing something specific in your application?

0
source

Emre He, according to your settings, you set only perm gen start / max size. Try adding these parameters to the JVM: -Xms128m -Xmx128m

0
source

Source: https://habr.com/ru/post/1411493/


All Articles