On Thursday 03 February 2005 22:45, ajith kumar wrote: > K S Sandeep wrote: > >>Hi , > >we need swap space double that of ur RAM, so > >>that one half of the Swap we can write,and from the other half we can > >>read back to the RAm. Its just like swapping two variable values, we > >>need a third temporary variable. Here we can veiw swap as made up of 2 > >>variables of the size equivalent to that OF ur RAM. Huh? > Ajith wrote :- > So if the /swap size is more than 2 times the RAM size then > the remaining in /swap partion which is more than 2 times the RAM is not > used. > > ie, > 128 MB is the RAM size > i made the /swap partion size as 300 MB > so in the 300 MB , > 128 MB is used as write > 128 MB is used for read > so toaly 256 MB is used as swap remaining 44 MB in /swap partion is unused. > > Correct me if im wrong.... No. The amount of physical memory does not constrain the size of your swap space[1]. If you have a system with 128MiB of physical memory you could have and use (painfully) over a GB of swap. On a 32-bit platform each process has their own 4GiB of virtual address space of which 3GiB (by default) is available for the process's use. Therefore one process could in theory use up to 3 GiB of swap space. (It never get all the way to 3GiB as some parts of a process will never get written to the swap space now matter how tight on memory you are.) Now multiply that by the maximum number of processes (minus the pages they share). And this half used for read and half for write claim is just boggling my mind. [1] The bookkeeping information needed to maintain all the swap space may use all of your physical memory. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/