How to measure the actual memory usage of Linux processes

2009-12-01 10:56:55 GMT

This is a much harder question than one might think as VSZ and RSS are not accurate.  /proc/{PID}/smaps provides the most accurate information as of Linux 2.6.16.

ps_mem.py is a nice script that summarizes smaps information on a per application basis and gracefully falls back to measure VSZ when no smaps support is found.