Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 26 Feb 2001 13:29:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 26 Feb 2001 13:29:00 -0500 Received: from perninha.conectiva.com.br ([200.250.58.156]:1290 "HELO postfix.conectiva.com.br") by vger.kernel.org with SMTP id ; Mon, 26 Feb 2001 13:28:47 -0500 Date: Mon, 26 Feb 2001 13:42:27 -0300 (BRT) From: Marcelo Tosatti To: "Mordechai T. Abzug" Cc: lkml Subject: Re: cache/swap issues under 2.4.1, 2.4.2 In-Reply-To: <20010226033713.A7120@red-sonja.sanctuary.arbutus.md.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 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/