vmstat
obtém o status da memória virtual de /proc/meminfo
e /proc/vmstat
e informações relacionadas ao processador de /proc/stat
:
% strace -fe open vmstat -s
...
open("/proc/meminfo", O_RDONLY) = 3
open("/proc/stat", O_RDONLY) = 4
open("/proc/vmstat", O_RDONLY) = 5
...
Para a memória usada, no link :
if (mem_used < 0)
mem_used = kb_main_total - kb_main_free;
kb_main_used = (unsigned long)mem_used;