lkml.org 
[lkml]   [2004]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ~500 megs cached yet 2.6.5 goes into swap hell
Timothy Miller <miller@techsource.com> [04/05/07 13:26]:
> >>>Perhaps what we really want is "swap_back_in" script? That way you
> >>>could do "updatedb; swap_back_in" in cron and be happy.
> >>
> >>swapoff -a; swapon -a
> >
> >
> >Good point... it will not bring back executable pages, through.
> >
> > Pavel
>
> Wouldn't this also be a problem if you are using more memory than you
> have physical RAM?

#!/bin/bash
swapused=$(( $(sed -n -e 's/ \+/-/g' -e '/^Swap:/p' /proc/meminfo | cut -d'-' -f2,4) ))
bufsused=$(( $(sed -n -e 's/ \+/+/g' -e '/^Mem:/p' /proc/meminfo | cut -d'+' -f6,7) ))

if [ $bufsused -gt $(( 11 * swapused / 10 )) ]
then swapoff -a; swapon -a
fi

or something like that
--
How can I live my life if I can't tell good from evil? - Fry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.096 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site