LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-29-2006, 03:05 PM   #1
Sören Schneider
Member
 
Registered: Apr 2005
Location: Brazil
Distribution: SUSE 9.0 Pro, SUSE OSS 10.0, KDE 3.4.2
Posts: 156

Rep: Reputation: 30
Why swap?


Hi,
why does Linux still need a swap, if a Linuxbox has more than 512M of RAM?
 
Old 04-29-2006, 03:17 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
It doesn't, unless you want to use more than your physical memory or some features like suspend to disk.
 
Old 04-29-2006, 07:46 PM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Linux should always have a small amount of swap space, whether you have 64MB RAM or 4GB RAM. Search, there were a lot of threads about this a couple of weeks back with extremely good replies
 
Old 04-29-2006, 08:14 PM   #4
tamoneya
Member
 
Registered: Jan 2005
Location: MA
Distribution: Ubuntu 7.10
Posts: 558

Rep: Reputation: 31
windows also does this. Just it is called page file. You can see page file usage in windows with ctrl-alt-delete and going to the performance tab.
 
Old 04-29-2006, 08:21 PM   #5
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
To be honest I have never seen any of my swap used (1024Mb Ram, 512Mb Swap) but just incase you do run out of ram; It's better to be safe then sorry. Is 512Mb of hard disk space that critical? Linux will run with no swap at all, infact I think its the only one that gives you this option windows and mac both 'swap'.

Last edited by johnson_steve; 04-29-2006 at 08:23 PM.
 
Old 04-29-2006, 08:53 PM   #6
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
http://www.linuxquestions.org/questi...highlight=swap
http://www.linuxquestions.org/questi...highlight=swap

I guess that search function must be broken, wonder why it worked for me...
 
Old 04-30-2006, 02:58 AM   #7
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
If you don't use swap, you must fear the infamous OOM (Out Of Memory) killer of the Linux kernel (see /usr/src/linux/mm/oom_kill.c), killing some processes in your system when there's no memory.
 
Old 05-01-2006, 05:50 PM   #8
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
Quote:
Originally Posted by primo
If you don't use swap, you must fear the infamous OOM (Out Of Memory) killer of the Linux kernel (see /usr/src/linux/mm/oom_kill.c), killing some processes in your system when there's no memory.
If you do use swap, you should still fear the OOM killer. I've had it kill a runaway frozen-bubble, but only after much thrashing. Having close to no swap would have been good here. But that's just my experience.
 
Old 05-01-2006, 07:10 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,668
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Personally, I agree that "you can afford a few megabytes of disk space." Should the system run out of RAM, it's in a pickle... and that swap-space just might save your a*s.
 
Old 05-01-2006, 07:17 PM   #10
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 32
Here's an an interesting thread on this very topic from kerneltrap.org. To make a long story short, you can get better performance with swap than without, regardless of how much physical RAM you have.
 
  


Reply

Tags
swap



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 On
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 12:57 PM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM
Swap punker22 Linux - Newbie 3 10-14-2003 12:27 AM
swap ematrixxx Linux - Newbie 7 08-20-2003 10:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:03 PM.

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
Open Source Consulting | Domain Registration