Memory, swap, and limits

James Kosin jkosin at beta.intcomgrp.com
Wed Jun 18 15:20:14 UTC 2008


Mikkel L. Ellertson wrote:
> James Kosin wrote:
>> Having TOO much swap space can be a detriment and not an asset.  
>> Usually, the rule of thumb I go by is allocate about 2x the amount of 
>> physical memory installed on the system; for machines with < 1M.  
>> This number will need to approach more or less 1x for machines with 
>> 1-2M.  With machines with > 2M; I'm not sure swap space will make 
>> much of a difference, unless you rely on X heavily.
>>
>> James
>>
> I have never head of a problem of having too much swap space. What 
> kind of problems does it cause? I know you get system slowdown if you 
> are doing too much swapping, but that is a different problem from 
> having too much swap space.
>
> Mikkel
Ok,

(1) The operating system has to manage the swap space like it manages 
memory space and allocation.  The swap space is a big area that has to 
be divided up just like the RAM.  The OS uses what is commonly called a 
page table to accomplish this.
(2)  As the memory and or swap space gets used and divided up with the 
applications this page table gets larger and larger  (don't worry, there 
is a limit).

Here is were it takes some understanding, I'm lacking at the moment.  To 
keep track of everything we have a single page table and a bit 
determines if we are talking about physical memory or swap memory.  In 
the OS; everything (or almost so) uses this page table to look up 
virtual addresses and maps them to physical addresses.  If the address 
is in swap space then a disk access is needed to get to the data; 
weather it pages the application back to physical RAM at this point is 
really up to the OS, some do and some don't.
This page table has to reside in PHYSICAL RAM somewhere usually to keep 
the access time down to a reasonable level.  If the page table grows too 
large you get issues with the table and lookup issues.

James

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20080618/f37b7e45/attachment-0001.sig>


More information about the fedora-list mailing list