I have a java program running in below memory parameters on a centos7 64bit box(total 512Mb memory):
-Xms80M
-Xmx128M
-XX:MaxPermSize=64M
-XX:MaxDirectMemorySize=32M
from the jvisualvm profile I can see its memory usage is max 130M (max used heap + max used Perm), but from the linux pmap command or top command it says it used about 310M, which occupy most of my server physical memory:
KiB Mem : 500840 total, 7700 free, 354256 used, 138884 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 109924 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
16844 root 20 0 1017504 311272 10388 S 0.7 62.1 4:43.65 java
I would like to know why the drastic different between pmap(top) statistics and my profiling result, and which is accurate?