Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should i look at VmSize, VmRSS, or some combination for memory stats on linux?

Tags:

linux

I am trying to calculate appropriate sizing data on a linux system for a product and am looking to determine memory usage. The way I am approaching it so far is by running:

cat /proc/<pid>/status

When looking at the output, but I am not sure which figures are relevant. For example:

VmPeak: 19662464 kB
VmSize: 18344416 kB
VmLck:         0 kB
VmHWM:   5942980 kB
VmRSS:   4734832 kB
VmData:  2108608 kB
VmStk:       120 kB
VmExe:      9256 kB
VmLib:    304448 kB
VmPTE:     10316 kB

I would think i would use VmSize (Virtual Memory right?) or VmRSS (Private Memory right?) or some combination to determine this, but I am not sure. Any pointers on correctly calculating the memory usage of a process in Linux?

like image 920
Jason V Avatar asked Dec 20 '11 20:12

Jason V


People also ask

What is VmRSS in Linux?

* VmHWM: Peak resident set size ("high water mark"). * VmRSS: Resident set size.

What is VMsize in Linux?

VMsize is the "address space" that the process has in use: the number of available adresses. These addresses do not have to have any physical memory attached to them. ( Attached physical memory is the RSS figure)

What is VM size Linux?

You can have 3GB of virtual memory per process (approximately, on many 32-bit Linux), and keep on creating new processes taking up gigabytes upon gigabytes of virtual memory.

What is VmHWM Linux?

A quick-and-dirty way to get the memory usage of the current process in Linux. Read /proc/self/status. The line VmHWM will tell you the memory highwater mark (max used) and VmRSS will give you the current memory usage.


1 Answers

I think the replys were not answering to your specific question. The key point is that the important value you have to take care is the RAM memory used in the system by your process.

Therefore:

  • In top is shown as residual memory: 'RES' column
  • In the '/proc//satus: 'VmRSS' value
  • In pmap command: 'RSS' total column value (at the bottom)

Cheers,

Antonio

like image 124
Antonio Avatar answered Sep 22 '22 23:09

Antonio