From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Bill J.Xu" Subject: Re: a swap partition utilization question Date: Wed, 26 Nov 2003 21:02:45 +0800 Sender: linux-admin-owner@vger.kernel.org Message-ID: <002301c3b41d$960fb950$2a02010a@avwindows> References: <001d01c3b31a$c003ec30$2a02010a@avwindows> <3FC3C0BC.6AC601E7@gelm.net> <001001c3b3d9$111352a0$2a02010a@avwindows> <16324.40312.496661.615314@cerise.nosuchdomain.co.uk> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT Return-path: List-Id: Content-Type: text/plain; charset="us-ascii" To: Glynn Clements Cc: chuck gelm net , linux-admin@vger.kernel.org Hi, Clements: Thank you for your detailed explains first. I use the linux box as a firewall, so it is highly loaded at any time.At most time, it's available physical RAM is less 2M, but SWAP partition is never used. This make me confused. Bill ----- Original Message ----- From: "Glynn Clements" To: "Bill J.Xu" Cc: "chuck gelm net" ; Sent: Wednesday, November 26, 2003 8:32 PM Subject: Re: a swap partition utilization question > > Bill J.Xu wrote: > > > > > After booting my linux box,I add a swap partition using "swapon > > > > /dev/hda5".but I found that swap partition was nerver used even > > > > 2M physics memory left. > > > > > > > > why? > > > > > > Perhaps swap memory will not be used until > > > all physical memory has been consumed. > > > > But I found that other linux box had used swap partition when many > > physical RAM left. > > > > root@FW_knl:/home/shiy# free > > total used free shared buffers cached > > Mem: 255320 247564 7756 0 15652 197560 > > -/+ buffers/cache: 34352 220968 > > Swap: 996020 1484 994536 > > root@FW_knl:/home/shiy# > > How long has the first box been up? And how intensive is memory demand > on that box? > > Swap won't be used at all until physical memory becomes close to being > exhausted. However, after that point, even if more memory becomes > available, data won't be moved back into RAM unless it is actually > used. > > There is often some data which will never be used again (e.g. memory > which is used by persistent daemons, but only during the > initialisation; the 6 getty processes running on tty1-tty6 which > typically never get used on a system which is running X, etc). Such > data is a strong candidate for being swapped out; once that happens, > it will typically never be swapped in again. > > So, when a system is booted, there will always be a period when no > swap is used. If memory demand is low, that period may last > indefinitely. OTOH, once memory demand has been sufficiently high to > have required the use of swap, swap usage will probably never drop > back to zero. > > -- > Glynn Clements > - > To unsubscribe from this list: send the line "unsubscribe linux-admin" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >