LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-13-2003, 01:54 AM   #1
Fuzzymath
LQ Newbie
 
Registered: Apr 2003
Posts: 7

Rep: Reputation: 0
Question How much swap do I need?


Hey, ok right off the bat, I'm a . And, I'm about to install linux for the first time. I've read a few books saying I'll need 2 partitions, 1 for linux, and 1 for swap space. Thats not a problem, I can set those up in partition magic. But, my question is, how much swap space do I need if I have 256k of ram? I've heard 128 one place, and some higher numbers else where. So, I thought I'd ask here. It seems you people have a good grasp of every thing :P
 
Old 04-13-2003, 02:01 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
256k? Is that a typo, 256MB maybe? If it's 256MB, then it matters what you will be using your distro for. If you plan on running any servers (such as Apache or FTP) then I'd suggest about a 256MB swap just to be safe. However if you are going to just be playing around and eventually breaking the system (it happens when you are learning how to use things sometimes) then you might be a bit more conservative with 128 or so.

This also highly depends on your drive space. If you've got tons, don't hold back. No more than about a GB of swap though, it's just wasted space then.

Let us know what you will be doing, and we will be able to provide a bit of a better answer

Welcome to LQ

Cool
 
Old 04-13-2003, 03:49 AM   #3
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
The usual easy rule is twice your physical RAM, mainly because it's hard to undershoot that way, I feel. As MasterC says, if you got loads of disk space, why not? But I think swap space is probably overrated. Depending on how much physical memory you've got and what distro you're using with what gui with what tasks, you may not need much if any, really. If I'm using VIM on the command line in Vector I'm not going to be swapping out a lot with 256 megs RAM. If I'm running KDE in Mandrake while compiling a kernel and running a server or whatever, it'd be different. If repartitioning isn't a problem you might try 256 swap and watch what you actually use and shrink it down (or conceivably enlarge it). But 128/256 should be plenty for most purposes, I'd think.
 
Old 04-13-2003, 04:28 AM   #4
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,185

Rep: Reputation: 52
the rule of thumb should be, figure out how much ram
you need, then get 3 times that much and screw the
swap. I occasionally have a few programs open, like
open office and other things, and have never seen
ram usage go above about 160 megs for programs.
the rest will be disk cache.
it pissed me off when i installed win2000 and, i have
a bunch of ram just so i don't have to screw with swap
space, and it made a 1 gig swap file. yea, so all of a
sudden since i bought extra ram, now i need more
swap space?, i dont' think so. all the programs assume
if you have the ram, you just need it for something, so
more swap.
anyway i've got a gig of ram for web browsing, and 4
hard drives in my machine, 1-80 gig, 2-120 gig's and
1-180 gig, and i don't want any stinkin swap.

anyway, if you've got 256 megs of ram, you don't need
any swap. if you want to play with it later, you can
make a swap file, to see how much gets used.
 
Old 04-13-2003, 05:32 AM   #5
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
Quote:
256k? Is that a typo
hey! i got me some 256k chips lying around here, so speak not...
; )

As for swap, you will most likely never need more than 256. OTOH, I would not know how much the latest KDE/GNOMRE takes, so 128MB may be too little (highly doubtful)- I run black/openbox with 128MB RAM, and I almost never use my swap.
 
Old 04-14-2003, 01:46 AM   #6
Fuzzymath
LQ Newbie
 
Registered: Apr 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Heh, sorry. 256MB, and I'm going to use mandrake 9.1 for a Home OS. I might run a FTP later down the road though...
 
Old 04-14-2003, 03:05 AM   #7
Fuzzymath
LQ Newbie
 
Registered: Apr 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Woohoo, I pulled it off. I installed mandarke with out any problems. I set up 512m of swap (A guy I know told me thats what I should use. After I talked with him for a bit about linux). Any way, thanks for you're help. I'm having a sound problem right now, but thats going to have to be another topic =)
 
Old 04-14-2003, 03:54 AM   #8
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
MasterC - 256 or 128
Me - 256 or 128
whansard - 0 or a swap file
cuckoopoint - 256 or 128

So, after posting a thread and us taking the time to answer you talk to a 'guy you know' who tells you 512 - twice the max any of the four of us said - when all of us implied those were generous numbers and even less would probably do - and you go for 512. Which is the same dumb info you get anywhere - "twice your physical RAM, twice your physical RAM".

I'm glad Mandrake went with no problems for you. Maybe you will need 512 and be happy you ignored us. And it certainly won't hurt unless you ever run out of disk space. But it makes me wonder what I posted for.
 
Old 04-14-2003, 04:16 AM   #9
Fuzzymath
LQ Newbie
 
Registered: Apr 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Sorry, I guess I screwed up by doing the install before checking back on this forum. Heh, nice way to start off in a new forum eh? I'll try to be more considerate next time I make a post about something
 
Old 04-14-2003, 08:03 PM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Quote:
Originally posted by digiot
MasterC - 256 or 128
Me - 256 or 128
whansard - 0 or a swap file
cuckoopoint - 256 or 128

So, after posting a thread and us taking the time to answer you talk to a 'guy you know' who tells you 512 - twice the max any of the four of us said - when all of us implied those were generous numbers and even less would probably do - and you go for 512. Which is the same dumb info you get anywhere - "twice your physical RAM, twice your physical RAM".

I'm glad Mandrake went with no problems for you. Maybe you will need 512 and be happy you ignored us. And it certainly won't hurt unless you ever run out of disk space. But it makes me wonder what I posted for.
I see your point, however when it's suggestions (even by the many) I wouldn't take it to heart when it's overlooked. If this person had an intimate conversation (meaning person to person, as in IM or better) then they probably got the info they needed to make a more educated decision than our blanket decisions I too feel ignored from time to time when I suggest something like this, however it's really nothing to worry about since it's personal preference on system performance

Cool
 
Old 04-15-2003, 02:30 AM   #11
Fuzzymath
LQ Newbie
 
Registered: Apr 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Heh, I talked face to face with him for about about 20 mins durring lunch (highschool student :P). He said if I have the diskspace to spare I might as well go all way the way. And seeing I have duel apx 200gigs. I didn't see any problems with his logic, and I installed as soon as I got home. LIke I said before, I'm sorry I didn't check here first. I've made posts like this on other subjects, on other forums, and no one every replied to me. So, I've gotten into a bad habbit of not checking things this this very much

Any way, thanks for the info. And I am sorry
 
Old 04-15-2003, 03:35 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 3,988

Rep: Reputation: Disabled
Just to ease your conscience: 2 - 3 times swap from what you have as RAM is no mere rumor. Lots of years ago engineers of Digital Equipment Corporation (DEC) investigated the necessary amount and came up with these numbers. I don't know of newer investigations, and sorry, no URL.
 
Old 04-15-2003, 05:37 AM   #13
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Nah, maybe I should apologize. I think it's true that a lot of people seem to post stuff and not really listen but there was no reason to single you out, Fuzzymath. MasterC's point is right - personal detailed conversation, especially with someone you know, counts for more than general posts from people you don't. So sorry about that. But for other people who sometimes just blow off others, my post still counts.

But, JZL240I-U, that's just it - those numbers are from when people didn't have half a gig physical memory. They're retained as conventional wisdom but I don't think it's quite right anymore. And from a time when memory wasn't so (relatively) cheap. Like whansard said - if you need it, get the physical memory if you can and screw the swap. But equally so, people didn't have 100-gig hard drives either though, so why not make a lot of swap. Either way.

I just think it's great that Linux doesn't kill machines with excessive demands - I like the software to run within the limits of the hardware instead of forcing you to upgrade, upgrade, upgrade, constantly. And, given that Linux is so efficient, I'm not in favor of huge swaps. But to each their own.
 
Old 04-15-2003, 05:58 AM   #14
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 3,988

Rep: Reputation: Disabled
Quote:
Originally posted by digiot
... [friendly statements deleted] ...

But, JZL240I-U, that's just it - those numbers are from when people didn't have half a gig physical memory. They're retained as conventional wisdom but I don't think it's quite right anymore. And from a time when memory wasn't so (relatively) cheap. Like whansard said - if you need it, get the physical memory if you can and screw the swap. But equally so, people didn't have 100-gig hard drives either though, so why not make a lot of swap. Either way.

... And, given that Linux is so efficient, I'm not in favor of huge swaps. But to each their own.
I didn't think about it that way, but I concede the point.

What I actually did, was increasing my swap to about 1 GB when I bought nice cheap RAM (640 MB), having only two 10 GB hard-disks. Therefore two questions:

1. How do I find out, whether and how much swap-space is ever used on my machine?
2. What happens if the machine has no swap but the system wants / needs some?

Any ideas?
 
Old 04-15-2003, 06:11 AM   #15
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Hm. I just know there's some specific thing that tells you exactly what you need to know, but I don't know what it is. I just type 'free' and check out the report. 'top' will do it, too, but I'm not sure its numbers are 100% accurate - neither are probably. Anyway - there's a memory used/swap used portion of it.

As far as what happens if you don't have enough - my first distro didn't enable swap automatically (or I screwed up the install) and it took me a bit to figure out I was running with no swap and to 'swapon'. X ran really slow. I've never run out, though, so I haven't experienced it first-hand, but I think if you absolutely run out your system locks up, so it is important not to run out.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 01:57 PM
Swap os2 Linux - General 1 03-18-2005 09:21 PM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 02:23 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 08:58 PM
Swap punker22 Linux - Newbie 3 10-14-2003 01:27 AM


All times are GMT -5. The time now is 12:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration