Swap size for a machine with 2GB of memory
From: [email protected] (Eric W. Biederman)
Date: 19 Aug 2001 14:49:23 -0600
"Eric S. Raymond" <[email protected]> writes:
> The Red Hat installation manual claims that the size of the > swap partition should be twice the size of physical memory, > but no more than 128MB.
>
> Should I believe the above formula?
You give two statements. The 128 MB bound was claimed by Microsoft and we screamed loudly that that was a lie - now it is claimed by both SuSE and RedHat. Funny.
No, the bound is not 128 MB. See mkswap(8).
With respect to swap partitions the current limit is about 64Gig. You can actually make a larger swap partition but the kernel on x86 only uses 24 offset bits into that partition. The 128MB partition existed but was removed long ago.
Long ago I wrote in mkswap(8) that the max on i386 is about 2 GiB. I seem to recall that at some point in time the swap size in bytes had to fit in a signed long, and indeed, 2.1.117 has
if (p->max >= 0x7fffffffL/PAGE_SIZE ...
2.2.0pre9 changed this into
if (p->max >= SWP_OFFSET(SWP_ENTRY(0,~0UL)))deleting this restriction.
If it is no longer there, I suppose I should change mkswap.c. Stephen, can you confirm?
Andries
Quoted 3 lines · Andries Brouwer
You give two statements. The 128 MB bound was claimed by Microsoft and we screamed loudly that that was a lie - now it is claimed by both SuSE and RedHat. Funny.
Oops!
I found /usr/share/doc/packages/yast2/README.partitioner Embarassing; considering that YaST2 is newer then the end of this limit ...
If you found more of them, please tell me, so it gets fixed.
TiA!
Signature · 3 lines
Kurt Garloff <[email protected]> Eindhoven, NL GPG key: See mail header, key servers Linux kernel development SuSE GmbH, Nuernberg, DE SCSI, Security
Quoted 9 lines · [email protected] wrote:
From: [email protected] (Eric W. Biederman)
Date: 19 Aug 2001 14:49:23 -0600"Eric S. Raymond" <[email protected]> writes:
> The Red Hat installation manual claims that the size of the > swap partition should be twice the size of physical memory, > but no more than 128MB.
>
Quoted 6 lines
> Should I believe the above formula?
You give two statements. The 128 MB bound was claimed by Microsoft and we screamed loudly that that was a lie - now it is claimed by both SuSE and RedHat. Funny.
No, the bound is not 128 MB. See mkswap(8).
I think that red hat means:
recoomended swap (machine) = min (128M, 2 * RAM(machine));
My personal recommendation is:
recoomended swap (machine) = 2 * RAM(machine);
(unless you know what you're doing). I run three machines with 0Mb swap: I know what I'm doing. If you know you're going to run VERY VERY large simulations which have sort of linear memory access patterns, it may pay to have LOTS more swap than normally recommended.
Also, You spend just a few percent on "recommended swap" in relation to what you just spent on "RAM (machine)". So even if you're never going to use it, it's still usefull.
Roger.
Signature · 4 lines
** [email protected] ** http://www.BitWizard.nl/ ** +31-15-2137555 ** *-- BitWizard writes Linux device drivers for any device you may have! --* * There are old pilots, and there are bold pilots. * There are also old, bald pilots.