Comment 10 for bug 27441

Revision history for this message
Colin Ian King (colin-king) wrote : Re: Thrashing hell

Hi,

Here is a simple shell script that will monitor you system's activities into two log files, vmstat.log and top.log. It will by default run for 600 seconds, but one can specify the number of seconds to run for if required. This can possible help you track down the rogue memory hogger.

vmstat.log will show you the general overview of system activity.
top.log will show per-process activity

#!/bin/sh
vmstat 1 > vmstat.log &
vmstatpid=$!
top -b -d 1 > top.log &
toppid=$!
if [ x$1 = x ]
then
        secs=600
else
        secs=$1
fi
sleep $secs
echo $vmstatpid $toppid
kill -KILL $vmstatpid
kill -KILL $toppid