User Tools

Site Tools


linux:system_info

Get Linux System Info

Get Linux Version Number

lsb_release -a

or

cat /etc/issue

Get Process RAM Usage

PROCESSID=1; TYPE="Rss";echo 0 $(cat /proc/`$PROCESSID`/smaps  | grep $TYPE | awk '{print $2}' | sed 's#^#+#') | bc

Where $PROCESSID is the name of the process you want to inspect and $TYPE is one of:

  • Rss: resident memory usage, all memory the process uses, including all memory this process shares with other processes. It does not include swap;
  • Shared: memory that this process shares with other processes;
  • Private: private memory used by this process, you can look for memory leaks here;
  • Swap: swap memory used by the process;
  • Pss: Proportional Set Size, a good overall memory indicator. It is the Rss adjusted for sharing: if a process has 1MiB private and 20MiB shared between other 10 processes, Pss is 1 + 20/10 = 3MiB
linux/system_info.txt · Last modified: by 127.0.0.1