I developed some appication in Java which is being initialized through init.d
script. After running the application for a while I found out the following:
$cat /proc/[java_app_pid]/cmdline
java-Xmx256m... other options
$cat /proc/[java_app_pid]/status
...
VmHWM: 669176 kB
VmRSS: 560352 kB
...
From what I can see the whole resident size memory consumption is 560MB
with HWM 669 MB
for 256 MB heap. It looks like inefficient memory utilization (HWM 2.5 times more than heap size).
My application does not allocate any direct buffers (explicitly). It catches file-system events through NIO and processes them.
My first thought was that headers consumed the memory. But as documented here for 64-bit VM they consumed 8 bytes for each instance. Where they resides(heap/offheap) is unspecified in the source I linked.
I wanted to make memory dump through gdb, but I don't know the address space the heap/non-heap memory resides at. Can you advice some direction to move to investigate the problem?