[Bug 27441] Re: Thrashing hell

Colin King colin.king at ubuntu.com
Tue Mar 11 15:08:58 UTC 2008


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

-- 
Thrashing hell
https://bugs.launchpad.net/bugs/27441
You received this bug notification because you are a member of Kernel
Bugs, which is subscribed to linux-source-2.6.15 in ubuntu.




More information about the kernel-bugs mailing list