To list all the high memory processes in cmd:
C:\Windows\System32>tasklist /fi "memusage gt 10000" Image Name PID Session Name Session# Mem Usage ========================= ====== ================ ======== ============ svchost.exe 1600 Console 0 30,296 K MsDtsSrvr.exe 964 Console 0 14,272 K Rtvscan.exe 920 Console 0 47,524 K searchindexer.exe 2364 Console 0 33,392 K explorer.exe 3220 Console 0 38,992 K vmware-tray.exe 2452 Console 0 20,068 K DSAgnt.exe 4252 Console 0 11,664 K Launchy.exe 4892 Console 0 17,704 K WindowsSearch.exe 5448 Console 0 11,800 K OUTLOOK.EXE 5004 Console 0 84,624 K pidgin.exe 5744 Console 0 24,308 K firefox.exe 4756 Console 0 122,652 K
cmddosloadmemoryprocessestasklist
This is a simple swap monitor script:
#!/bin/bash
# Notify me one time if my swap is over MAXSWAP and log the
# swap usage as well in SWAPLOG.
# Usage: ./monitor.sh &
SWAPLOG=~/logs/monitor/swap
MAXSWAP=5
INTERVAL=30
send_sms_msg () {
if [ "$1" ]; then STRING=$1; fi
if [ $SMS_SENT ]; then
return 0
else
echo $STRING | mailx -s 'monitor msg' 5101234567@cingularme.com
SMS_SENT=1
fi
}
while true; do
# parse free output, get current swap value
swaptest=`free -m |grep Swap|perl -pe 's/Swap:\s+\S+\s+(\S+).*/$1/'`
if [ $swaptest -ge $MAXSWAP ]; then
echo `date` Swap is: $swaptest >> $SWAPLOG
send_sms_msg "Swap is: $swaptest"
fi;
sleep $INTERVAL
done;
bashmemorymonitorscriptshellswaptools