From owner-freebsd-questions Fri Mar 8 3:41:55 2002 Delivered-To: freebsd-questions@freebsd.org Received: from morgan.upsys.se (kosmos.upsys.se [192.71.194.144]) by hub.freebsd.org (Postfix) with ESMTP id C3EB237B405; Fri, 8 Mar 2002 03:41:48 -0800 (PST) Received: from localhost (mauritz@localhost) by morgan.upsys.se (8.11.1/8.11.1) with ESMTP id g28BsH129579; Fri, 8 Mar 2002 12:54:18 +0100 (CET) (envelope-from mauritz.sundell@telia.com) X-Authentication-Warning: morgan.upsys.se: mauritz owned process doing -bs Date: Fri, 8 Mar 2002 12:54:14 +0100 (CET) From: Mauritz Sundell X-X-Sender: To: Cc: Subject: swap-usage Message-ID: <20020308115843.O29414-100000@morgan.upsys.se> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG After I have read about The FreeBSD VM System in the FreeBSD Handbook I started to wonder if the swap-area(s) are used for more things than I thought. The questions below is not only applicable on FreeBSD but the questions popped up in my head while reading whis article. For me the swap-area is used only then the system have used all available physical memory and need more and as soon as the memory need decreases the swap is unused again. Further I do not think that where are many applications that allocates more memory if there are more memory available. So why should I have swap partions on each physical disk? Why should I have 2x the swap-space as main memory? A person that have a system with 64MB RAM and 128MB swap wants to speed up and buy another 64MB RAM, installing the RAM the swapping should decrease and the swap-area could even by decreased. Ok, now the person feel that the system goes smoother and tend to have more applications running at the same time when before. But if he felt the system was slow before update he probably dont want more swapping to be done than before so why should the swap be increased by an other 128MB? Why should the usage of memory suddenly increase from 192MB to 384MB because of an upgrade with 64MB? The only time I want to increase swap-area is if I need more (cheap and slow) memory. Is there any unusal events that demands much swap to work? If one wants crashdump at panics it can be assigned at crashdevice without swapping (but it is no cost to swap on an anayway allocated crasharea since it is not used in normal run) So if I deside not to have any swap-areas what do I miss besides a good place for crash-dumps? I know that thumb-rules as twice as much swap as ram is very common for other OS as well but I have never been told why. In http://docs.freebsd.org/handbook/en/4.3R/internals-vm.html writes: "Second, configure sufficient swap. You should have a swap partition configured on each physical disk, up to four, even on your ``work'' disks. You should have at least 2x the swap space as you have main memory, and possibly even more if you do not have a lot of memory. You should also size your swap partition based on the maximum memory configuration you ever intend to put on the machine so you do not have to repartition your disks later on. If you want to be able to accommodate a crash dump, your first swap partition must be at least as large as main memory and /var/crash must have sufficient free space to hold the dump" -- Mauritz Sundell, mauritz.sundell@telia.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message