isenberg
I'm new here

Analyzing memory usage on Unix (Linux, Solaris, AIX)

On Unix operation systems almost always all RAM is completely used. This is usually no fault and normal behavior as the operating system tries to utilize the hardware as efficient as possible. Almost all RAM not used by user processes is allocated for the file system cache and will be automatically reassigned to processes if any process asks for more memory.

On a machine with 256 GByte built in RAM you might see the following output:

$ free -m

  total used free shared buffers cached

  Mem: 258077 257235 841 0 4904 235554

This means, of the 258077 MByte of built-in RAM, 4905 MByte + 235554 MByte is used for the file system cache and could be used by any process.

To determine the amount of memory used by each user process, use "top", the parameter is the username the FirstSpirit Server is started with, usually fs5:

$ top -u fs5

PID  USER PR  NI  VIRT   RES    SHR   S %CPU %MEM TIME+   COMMAND

7558 fs5  20  0   34696  1784   1072  S 0    0.0  0:05.50 wrapper-linux-x

7562 fs5  20  0   3856m  972m   14m   S 0    1.5  6:36.47 java

If top is not available, use "ps":

$ ps -o user,pid,nlwp,osz,rss,vsz,pcpu,time,etime,comm -u fs5

USER PID  NLWP SZ RSS    VSZ     %CPU TIME     ELAPSED  COMMAND

fs5  7558 3    -  1784   34696   0.0  00:00:05 03:23:59 wrapper-linux-x

fs5  7562 118  -  994864 3948564 3.2  00:06:36 03:23:59 java

RES or RSS is the amount of RAM directly used by the process, here 972 MByte.

VIRT or VSZ is the sum of all memory, including virtual memory used by the process, here 3856 MByte.

SHR is memory used by shared libraries, usually only a small amount.

The value shown by VIRT should be about the same magnitude, maybe 50% more, as the memory setting for the Java VM is set to with parameters wrapper.java.maxmemory in file firstspirit5/conf/fs-wrapper.conf.

Labels (2)