LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   swap partition size? (https://www.linuxquestions.org/questions/linux-newbie-8/swap-partition-size-102209/)

Toker 10-09-2003 04:14 PM

swap partition size?
 
I've got 1GB 2700 ddram and a crap load of unpartitioned space. I reading alot of things that claim with that much ram, I don't need a swap drive, but could it really hurt? With programs growing in size, I'd feel safer with a "back-up" swap drive, and I'm just wondering how big I should make the partition... half, equal or twice the ram size seems to be the obvious options...

Any opinions?

jowid 10-09-2003 04:21 PM

Mine swap space has the same size as the ram in my machine. And i have got no problems.

Maybe this helps you.

Greetings,
Jochen

rshaw 10-09-2003 04:33 PM

it used to be 2 x ram, but that really only applies to low mem machines. 250MB-500MB will work fine

Gill Bates 10-09-2003 04:35 PM

i go about 700mb just in case;
only saw it using 600 once, but that was when one of my apps was running out of control :O

trickykid 10-09-2003 05:12 PM

I tend to make mine from 100mb to 200mb.. Most of the time I'm wasting space with that even as its rarely touched.

Desktop machine with normal apps and you got over 128 megs of ram, go with 100 to 125 mb for swap.

Server with many many users, use double your RAM or no more than a gig or so.. that's if you got the hard drive space, etc.

car313 10-09-2003 09:39 PM

1 gb ram seems plenty. so from what i have heard, you dont really need a swap partition unless of course the install procedure is bent on asking for some swap space.

car313

trickykid 10-09-2003 11:13 PM

Quote:

Originally posted by car313
1 gb ram seems plenty. so from what i have heard, you dont really need a swap partition unless of course the install procedure is bent on asking for some swap space.

car313

Its still in the best interest to create a swap partition, even if you have 4 GB of RAM... I would only recommend a 100 meg size swap at a minimum and maximum in all cases.

J.W. 10-11-2003 12:48 AM

I've got 1GB of RAM on my rig with a 256Mg swap file. The swap file hardly ever gets touched, and when it does, it's a very minimal impact. The way I look at it is with the large drives these days, a couple hundred meg won't make much difference one way or the other, but at the same time, why waste space unnecessarily. From what I've seen, and what other posters have noted, is that the "double the RAM" guideline is obsolete, and generally either 256Mg or 512Mg of swap ought to be sufficient no matter how much RAM you've got.

All I can say is that for me, 256Mg has been way more than enough. -- J.W.

Gill Bates 10-11-2003 02:23 AM

unless u are in development and ur own apps can go wrong ... :)

robotoverflow 10-11-2003 11:41 AM

Since you have 1GB of RAM I doubt that the swap would even be used that much, no matter what you use that system for. You should be able to set it to around 50MB and not feel any loss of performance. Mind you, that's a safe figure, you could probably go lower. If you find out that you do need a larger swap there are ways to work out how large it has to be.

The amount of swap you need depends on what you're using it for and how much Memory you have. You can usually work out how much you need by estimating how much memory is required in total (physical & virtual) and subtracting the amount of physical Memory you currently have. The remainder is what your Swap size should be. It's good for system performance if you can hit that 'sweet spot', since a swap that's too large will be slower to read & write to at times, and that's a bad thing.

Estimating how much you need in total is the hard bit, since you never really do the exact same thing ALL the time on systems such as workstations or multimedia machines. You have to work out what the worst case scenario is regarding ram requirements and set the swap so it can deal with it if need be. If you have no idea what the amount you require is, your best bet is to over-estimate and set the swap, test it out by running your system under load, and then resizing it to a smaller size if you feel that your system wouldn't lose any performance.

Gill Bates 10-11-2003 12:40 PM

do large swap sizes slow down performance?

robotoverflow 10-11-2003 12:52 PM

Well it depends on what you're doing I guess. If you're playing games (like Quake 3, etc) or multitasking like crazy, then yeah, going overboard with the size can effect your performance. There's an article at www.adriansrojakpot.com that goes into detail about swap file optimisation. I can't remember if it covers swap files in linux but it should still be very relevent.

Gill Bates 10-11-2003 02:27 PM

isnt that windows specific though?

robotoverflow 10-11-2003 02:54 PM

Quote:

Originally posted by robotoverflow
I can't remember if it covers swap files in linux but it should still be very relevent.

Gill Bates 10-12-2003 07:43 AM

well given the drastically different virtual memory management of windows and linux i would not say it is relevant at all

:twocents:

robotoverflow 10-12-2003 08:20 AM

I know that they're very different, but all things aside they still essentially do the same thing and they both use Hard Disks to facilitate their funtion. (in most cases) I'm not saying that the entire article is relevant to a linux user, though parallels can still be drawn between the methods that windows and linux use and it still covers how a hard disk drive functions and discusses the benefits of setting the swap to a certain size, etc. For a person that knows nothing about the subject this can be a reasonable source of information on the topic.

Feel free to point out any other good articles about swapfiles as i'd like to read them. :)

Gill Bates 10-12-2003 11:19 AM

maybe i am wrong about this, but i cant see why linux would use a smaller swap space more effeciently than a larger one, given the way windows uses the swap drive i could see why making it smaller would make the machine run more smoothly.

we all know about virtual memory management, but its very hard to locate any relevant articles on the techniques used to implement them on nix architectures - u probably have more than me (i have 0)


All times are GMT -5. The time now is 03:06 AM.