You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Louis Charette edited this page Apr 19, 2014
·
1 revision
Example script to check the memory usage.
#!/bin/bashiftest -n "$1"thenecho"RSS Column is the memory used in kilobytes (divide by 1024 to get megas)"elseecho"Usage mem_stats apache2 or mem_stats all or mem_stats mysqld"exit 1
fi
free -m
if [ "$1"="all" ];then
ps -ylA --sort:rss
else
ps -ylC "$1" --sort:rss
fiexit 0
Example output
RSS Column is the memory used in kilobytes (divide by 1024 to get megas)
total used free shared buffers cached
Mem: 2002 1769 232 0 89 609
-/+ buffers/cache: 1070 932
Swap: 3074 367 2707
S UID PID PPID C PRI NI RSS SZ WCHAN TTY TIME CMD
S 33 19531 19529 0 80 0 3352 2507 ep_pol pts/4 00:00:00 aped-1.1.2-dev-