Date: Fri, 8 Mar 2002 10:54:29 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Mauritz Sundell <mauritz.sundell@telia.com> Cc: <questions@FreeBSD.ORG> Subject: Re: swap-usage Message-ID: <200203081854.g28IsTw78250@apollo.backplane.com> References: <20020308115843.O29414-100000@morgan.upsys.se>
next in thread | previous in thread | raw e-mail | index | archive | help
: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. : :-- :Mauritz Sundell, mauritz.sundell@telia.com Well, it's all relative. These recommendations are based on getting the maximum performance and durability possible out of a heavily loaded machine. If you have a lightly loaded machine, which is fairly typical for a workstation, you do not have to configure the swap as if your box was a server. Still, even for a workstation having a good chunk of swap can be useful to deal with the occassional runaway program or large demand-paged applications such as Mozilla, staroffice, and so forth. And I know quite a few people who leave dozens of applications open on their desktops. Having swap allows the kernel to page-out idle applications and free up more physical memory for the active applications and for file caching. If you have a large hard drive then configuring a big chunk of swap doesn't hurt. When I first purchased my current workstation it had 64M of ram. I configured 512M of swap. I later upgraded the workstation to 128M, then 256M of ram. The swap is almost completely unused now but there are occassions when I am glad its there, and by being generous when I initially created it I have not had to worry about it at all in three years. To me the ability to 'configure and forget', to not have to worry about it ever again on this machine, is worth it. -Matt Matthew Dillon <dillon@backplane.com> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203081854.g28IsTw78250>