#ram
6 one-liners with this tag.
All one-liners tagged ram
Find out which processes are using swap
$for f in /proc/[0-9]*/status; do awk '/^Name:/ {n=$2} /^VmSwap:/ {print $2, "kB", n}' "$f"; done 2>/dev/null | sort -rn | head -15
Find processes killed by the OOM killer
#journalctl -k --no-pager | grep -iE "out of memory|oom-kill|killed process"
Show installed RAM modules and free slots
#dmidecode -t memory | grep -E '^\s+(Size|Type|Speed|Locator|Manufacturer|Part Number):'
Show memory, swap areas and swappiness
$free -h && swapon --show && cat /proc/sys/vm/swappiness
Show processes with the highest RAM usage
$ps -eo pid,user,%mem,rss,cmd --sort=-rss | head -15
Sum up RAM usage per program
$ps -eo rss=,comm= | awk '{a[$2]+=$1} END {for (p in a) printf "%8.1f MB %s\n", a[p]/1024, p}' | sort -rn | head -15