0

I was following this Checking Ram size article for my cloud foundry Java app running on Ubuntu LTS 14.04. From what I understand the physical memory of the instance running my Java process is 32g. For the Java app I specified the heap size as 1g. When I look at the output of top command, I see that it has 3,221,372 KiB which is 3g.

Is there a logical explanation of

  • Why Java process is using 3g virt memory when there is adequate physical memory and

  • Why Java process is using more memory than 1g, I specified?

Result of grep MemTotal /proc/meminfo | awk '{print $2 / 1024}'

32170.2

Result of top command output:

Tasks:   5 total,   1 running,   4 sleeping,   0 stopped,   0 zombie
%Cpu(s): 46.2 us, 43.2 sy,  0.0 ni,  1.7 id,  0.3 wa,  0.0 hi,  8.5 si,  0.2 st
KiB Mem:  32942284 total, 27706852 used,  5235432 free,   357028 buffers
KiB Swap: 32949308 total,  2546016 used, 30403292 free.  6546428 cached Mem

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                  
      7 vcap      10 -10 3221372 108524  11936 S   1.7  0.3   1:31.17 java               

Result of free -g

             total       used       free     shared    buffers     cached
Mem:            31         26          4          0          0          6
-/+ buffers/cache:         19         11
Swap:           31          2         28

0 Answers0