O'Reilly logo

Mastering Embedded Linux Programming by Chris Simmonds

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Per-process memory usage

There are several metrics to measure the amount of memory a process is using. I will begin with the two that are easiest to obtain— the virtual set size (vss) and the resident memory size (rss), both of which are available in most implementations of the ps and top commands:

  • Vss: called VSZ in the ps command and VIRT in top, is the total amount of memory mapped by a process. It is the sum of all the regions shown in /proc/<PID>/map. This number is of limited interest, since only part of the virtual memory is committed to physical memory at any one time.
  • Rss: called RSS in ps and RES in top, is the sum of memory that is mapped to physical pages of memory. This gets closer to the actual memory budget of the process, but there ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required