[PLUG] Swap usage keeps increasing

Steve Bonds 1s7k8uhcd001 at sneakemail.com
Thu Mar 25 14:23:01 UTC 2004


On Thu, 25 Mar 2004, Mel Andres mel97215-at-comcast.net |PDX Linux| wrote:

> Is this indicative of a memory leak?

This looks like a memory leak since you say it's creeping upwards over
time.  A 768MB total virtual memory space should be adequate for what
you've mentioned.  256MB real memory is a bit low, but not completely out
of the question.

> If I increase my physical memory, will that resolve my problem, or just
> buy me more time?

I suspect this will just buy you more time.  It may be easier to simply
boost your swap space if you're not seeing any performance problems.

If you *are* seeing performance problems, then get the memory.

To identify the culprit, try running this for a day or so:

-----
while true; do
    FILE=/tmp/$0.`date +%Y%m%d-%H%M%S`
    echo "Collecting process size info and storing it in $FILE"
    ps -e -o pid,command,fname,vsz | sort -n +4 > $FILE
    sleep 3600
done
-----

After it's run for a while do a "diff" on the first and last files to see
how memory usage has changed for each process.  Those with a large delta
for the same PID are likely to be the source of your problems.

Once identified, then you can just restart that program periodically to
avoid the memory leak.

Or just add swap.  ;-)

  -- Steve




More information about the PLUG mailing list