Click to See Complete Forum and Search --> : multiple swap partitions and a question about total swap space
doublec16
03-04-2003, 02:45 PM
I'm installing RH8 and I'm considering making multiple swap partitions on different drives. If there is more than one swap partition, will it use all of them as it needs to? Would there be a problem for a single process to use space from more than one swap partition at once? I ask because I am in the process of writing a VERY memory intensive program and I can't afford GB upon GB of RAM at the moment, so if I make a couple of fair sized swap partitions will the program make use of all available swap as it needs, no matter where it is?
Also is there a maximum amount of swap that can be allocated? I know that it's supposed to be twice the RAM but so far I haven't swap partitions that big (and I have upgraded my RAM after I installed so I couldn't easily just double the swap space), but now I want a few GB of swap with 512MB of RAM (possibly upgrading to 1GB of RAM at some point). I do realize that swap access isn't as fast as RAM, but there isn't much choice. Does that amount of swap space seem reasonable? Thanks.
michaelk
03-04-2003, 03:14 PM
You can have multiple swap partitions and linux will use the space as required no matter where it is located. The max size of the a single partition is limited to 2GB and I think you can have up to 8 swap partitions (Don't quote me on the number). In addition to swap partitions you can also have swap files. Not as fast as a partition but it is an easy way to increase your swap size without repartitioning the hard drive.
Look here for the details: http://www.justlinux.com/nhf/Filesystems/Fly_Swapping.html
I only have a rudimentary understanding of how memory allocation works in linux so I can't say if its reasonable or not.
mdwatts
03-04-2003, 07:32 PM
Originally posted by michaelk
You can have multiple swap partitions and linux will use the space as required no matter where it is located. The max size of the a single partition is limited to 2GB and I think you can have up to 8 swap partitions (Don't quote me on the number). In addition to swap partitions you can also have swap files. Not as fast as a partition but it is an easy way to increase your swap size without repartitioning the hard drive.
Look here for the details: http://www.justlinux.com/nhf/Filesystems/Fly_Swapping.html
I only have a rudimentary understanding of how memory allocation works in linux so I can't say if its reasonable or not.
Perfect !!! (AFAIK)
Just make sure you have all the multiple swap partitions defined in your /etc/fstab.
LinuxLuke
03-04-2003, 11:19 PM
good god man... what kind of program are you writing!? who needs THAT much memory?
doublec16
03-05-2003, 12:01 AM
Well, since you asked, I'm writing a simulation program of a certain type of star that will need to store in memory 10 different physical parameters (possibly but hopefully not in double precision) of as many positions in space at once as possible. The more memory I have the fewer iterations it has to do. I calculated that if I do the whole thing at once I will require 40GB of memory, but I think I'll settle for the 3GB or so I have with combined RAM and SWAP, or else it'll take forever (and use up an entire hard disk).
I am also writing a program to do FFTs of astronomical data to detect pulsations. That doesn't require so much memory, but the more the better. Its a PhD thesis thing and the computers at school are just too slow.
LinuxLuke
03-07-2003, 03:02 AM
times like this I wish I was a genius...