Re: cache/swap issues under 2.4.1, 2.4.2

From: Marcelo Tosatti (
Date: Mon Feb 26 2001 - 11:42:27 EST

On Mon, 26 Feb 2001, Mordechai T. Abzug wrote:

> Why do I have 47MB of swap in use? I thought at first that it might
> be due to the minimum allowable cache size, but considering that there
> was only 48MB of RAM in use to begin with, that still seems
> suspicious. Even weirder, if I then turn off swap, the usage looks
> more reasonable:
> # swapoff -a
> # free
> total used free shared buffers cached
> Mem: 255564 53900 201664 0 840 9356
> -/+ buffers/cache: 43704 211860
> Swap: 0 0 0

The "used" swap space here means _allocated_ swap space, not necessarily
used swap space.

Linux 2.4 allocate's swap space for an anonymous page when it unmaps a
page table entry mapping the page. When it allocates the swap space, it
also adds the page to the swapcache to be written later.

The swapcache is part of the pagecache. The swapoff rips all the
swapcached pages on the device, thats why you see a lot less memory
"cached" after the swapoff.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Feb 28 2001 - 21:00:11 EST