> Okay. So I dd'ed 32meg from /dev/zero to /tmp and tried to edit it. As you
> predicted,it started swapping like crazy. I didn't wait for the edit to actually
> present data,
> I eventually killed it. Now there seems to about 14meg of swap in use, and I have
> about 22.5 meg of physical memory free.
> Before editing the huge file, about 46 meg of my 48 was in use. Now, a large chunk
> seems to persist in swap. This now sounds like a tuning issue. At least, I'm aware
> that there are some tuneables available. Short of reading the source code carefully,
> is there
> any place I can find a decent description of how to use them?
Well, first of all - that 'used' swap isn't just going to go away,
I mean, although top may say so much of it is 'used' , *none* of
it is being wasted - it's all right there for you if you suddenly decide
you really want to do that dd again - it'll go much quicker -
HOWEVER - as soon as that space is needed for some other use, the old
data that was there will be overwritten to store the next needed bit
To show I'm not just making this up - try a test in a somewhat
do a: 'find / -name netscape'
wait, and listen to your drive go a' spinnin' .
after the command has finished do a:
'find / -name xterm'
now ... hey! why is your drive hardly churning? and why did it scan your
whole filesystem so quickly?! --
Whatever (tiny) bit of memory that was used by the 'find' would still
be marked by the kernel as being 'used' - just for if you happen
to need it again - and it'll stay there until it eventually gets
swapped out with some other data. The same thing basically happens
with the swap space. So, what your seeing is definately not a
problem - quite the contrary, it's linux's kick ass memory utilization
As for how to finer tune things by hand - check out 'memory-tuning.txt'
in /usr/src/linux/Documentation ( or wherever you put your kernel
source ). There really isn't *too* much info in this document, but