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?
* VmHWM: Peak resident set size ("high water mark"). * VmRSS: Resident set size.
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)
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.
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.
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:
Cheers,
Antonio
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With