1

I would like to ask question about vmstat.

I run a jvm engine on top of linux kernel (RHEL 7.3) and want to know the actual memory which process can use.

I use vmstat to see the amount of available memories but I am not sure if the report includes the java heap commited bytes or java heap used bytes.

Below is the example of vmstat which I use. My environment is

OS mem   : 4GB
JVM Heap : 2GB


[ywatanabe@localhost tmp]$ vmstat 1 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  0      0 771932   2108 546772    0    0    34    81  189  161  5  1 95  0  0
 0  0      0 771932   2108 546776    0    0     0     0   82  115  0  1 99  0  0
 0  0      0 771932   2108 546776    0    0     0     0   74  111  0  0 100  0  0

Which does the free column exclude? java heap commited bytes or the java heap used bytes?

1 Answer 1

1

The vmstat free column is reporting the amount of physical memory (RAM) which doesn't contain anything used or usable by the system, so that can be immediately allocated.

Java heap committed bytes is representing the amount of virtual memory that the JVM has requested from the OS.

Java heap used bytes is representing the amount of virtual memory that contains actual data (objects).

Given the fact virtual memory might be present in RAM, on disk (files or swap) or nowhere, you cannot reliably compare RAM and virtual memory usage.

1
  • @jilliagre Okay. Understood. Thank you for clarifying. Commented Dec 10, 2017 at 3:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .