Re: swap size for 2gb 2 processors?



On Thu, 21 Dec 2006 09:58:22 -0700, ray wrote:

On Thu, 21 Dec 2006 04:58:21 -0900, Floyd L. Davidson wrote:

General Schvantzkoph <schvantzkoph@xxxxxxxxx> wrote:
On Thu, 21 Dec 2006 11:22:22 +0000, Ron Hardin wrote:

How big should I partition swap for 2gb ram 2 processors? Planning
out a partition magic run on a 120 gb disk, sharing with windows XP.


The rule of thumb is 2 * RAM size, in your case that would be 4G. This is

There is no such rule of thumb for Linux, and *never* has been.
Use Google and learn something about it before you post false
statements.


Do you know what a 'rule of thumb' is? In days past, there was indeed a
rule of thumb if not a hearty recommendation for swap = 2*physicalRAM.
This was in the day before 1gb was fairly common, but indeed, it was there.

I got that figure (2 * RAM) from the Redhat manuals, probably RH5.2, or
RH6. It might be dated but there isn't a lot of reason to change it
because the price of disk storage is so low, 4G of disk space costs a
little over $1. Given that RAM and disk prices both follow similar pricing
curves (although disks were on a much steeper curve for a while) that
price for a swap partition has remained reasonably constant. If you don't
like the 2X rule how about substituting the $1 rule. i.e. your swap
partition should cost $1.

The purpose of having swap space has changed over the years. When virtual
memory was first introduced in the 1960s a large mainframe measured it's
core size in Kbytes. Virtual memory provided a means of handling multiple
jobs which could be swapped in and out of memory. Even into the 1980s the
main memory size of a large system was only a few megabytes so the swap
space was heavily used. Today most new PCs have at least 2G of RAM and 8G
can be had for about $1K. In today's world you should never be swapping, if
you are then you should add more RAM. The swap space is just an insurance
policy, it gives the OS a place to put things in the event you decide to
run a really large process that eats the entire memory. The 2X rule means
that you can swap out everything and then some. The $1 rule looks at it
differently, you are setting aside a trivial percentage of your disk space
as insurance that you won't ever run out of virtual memory.
.



Relevant Pages

  • Re: [ck] swap prefetching merge plans
    ... After I close some memory demanding aplication that caused huge portion of the memory to be swapped out to disk, the time needed to swith back to firefox or eclipse is really really shorter. ... And software engeneerers and programmers are really working hard to eat all your RAM even if you think that "now you have really much". ... I have so much swap because I am compiling I my packages on tmpfs. ...
    (Linux-Kernel)
  • Re: VM system - memory seems to be running out, when its not
    ... No extra RAM allocation would occur until the pages are used. ... amount of RAM as a swap space. ... The VM space can have a dedicated area on disk. ...
    (comp.unix.solaris)
  • Re: headsup: swap_pager.c
    ... disk could not keep up with page-in demand. ... "add" another disk while the box is spasticly trying to swap ... around a 200M plus working-set into 32M physical RAM. ... bash me more...I still dont understand why you are trying to fix ...
    (freebsd-arch)
  • Re: why the difference in swap value for vmstat output
    ... > RAM and 56 G of disk swap ... The second is free RAM. ... < This line left intentionally blank to confuse you. ...
    (comp.sys.sun.admin)
  • Re: why the difference in swap value for vmstat output
    ... > RAM and 56 G of disk swap ... The second is free RAM. ... < This line left intentionally blank to confuse you. ...
    (comp.unix.solaris)