Here I am explaining how to check memory usage in the user space, especially from the command line. There are two perspective to see memory usage – System level and per-process level.
System level memory usage check
- free
- top
- /proc/meminfo
- /proc/buddyinfo
- /proc/pagetypeinfo
- vmstat
- /var/log/sa/sa[r]*
- /proc/vmstat
- /proc/slabinfo
- slabtop
- ipcs
Per-process level memory usage check
- ps
- pmap
- /proc/<pid>/maps
- /proc/<pid>/smaps : especially Pss : https://lwn.net/Articles/230975/
System level memory usage check
free

top


/proc/meminfo

/proc/buddyinfo

/proc/pagetypeinfo

vmstat

/var/log/sa/
You can get historical system data which also include memory usage history. There are some nice tools that is working with this sar
data.
- Red Hat Memory Analyser Lab : https://access.redhat.com/labs/rhma/
- kSar : https://github.com/vlsi/ksar
/proc/vmstat

/proc/slabinfo

slabtop


ipcs

Per-process level memory usage check
ps

pmap

/proc/<pid>/maps

/proc/<pid>/smaps

Leave a Reply