LinuxQuestions.org
Help answer threads with 0 replies.
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 01-31-2005, 01:26 AM   #1
leduytien
Member
 
Registered: Oct 2004
Posts: 39

Rep: Reputation: 15
install Linux without swap partition?


Hi,

I installed Fedora Core 3 without a swap partition and were warned by the installer that this will affect the perfomance of most installation. Is that true? (after installing, I feel my screen updated a little bit slower - but don't know whether it's my imagination or ...)

Can anyone explain what this "swap partition" do? do it act like the swap memory used by Windows?
 
Old 01-31-2005, 01:49 AM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
yes it's swap memory
it will get used very little if you have alot of ram
but you won't have to wonder if it's affecting performance
when it becomes needed and it's not there your gui will lock up and freeze solid and will not recover
 
Old 01-31-2005, 01:50 AM   #3
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,296

Rep: Reputation: 65
Re: install Linux without swap partition?

Quote:
Originally posted by leduytien
Hi,


Can anyone explain what this "swap partition" do? do it act like the swap memory used by Windows?
that's it. it's about the same thing. if you have more than 200 megs of ram, you won't run into many situations where swap would help much.
 
Old 01-31-2005, 01:49 PM   #4
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Re: Re: install Linux without swap partition?

Quote:
Originally posted by whansard
that's it. it's about the same thing. if you have more than 200 megs of ram, you won't run into many situations where swap would help much.
. . . aside from applications terminating without notice.

Plan to run a window manager with effects? Plan on doing any multitasking? Do you browse using a tabbed browser? Do you do any image editing in The Gimp? If the answer to any of those questions is "yes" then you definitely want swap space, and it should be a minimum of somewhere between 1.5x and 2.5x the amount of installed RAM. I run a gig of RAM on my workstations and when multitasking my machines use swap space. Granted, I often work with high-resolution images intended for print, but it still drives the point home that swap is very necessary.

If you don't want to dedicate a partition to swap, you can get by using a file on your / partition, but it may impact performance slightly.
 
Old 01-31-2005, 03:43 PM   #5
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,296

Rep: Reputation: 65
there's a bunch of threads on this site with arguments about whether you need swap or not. using the above argument would make you believe that having 32 megs of ram with 100 megs swap is more stable than 512 megs of ram with no swap. running out of ram for applications is not worse than running out of ram+swap for applications.
 
Old 01-31-2005, 03:49 PM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
If you have a lot of ram, usually more than 512 megs or 1gb you can get away without needing a swap space, but in doesn't hurt to configure your system to use, especially if you play games or do stuff thats graphic intensive. There have been a few articles on the net recently rgarding this issue about swap space, so you may want to do a google search to find out other peoples opinions.
 
Old 01-31-2005, 05:44 PM   #7
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
It all comes down to the fact that hard disk space is much cheaper than RAM (well, cheaper in dollars, a lot more expensive in wasted time ). You probably won't notice if 1GB is unavailable from your 160GB hard disk, and it could save you from crashes if you ever do manage to use up the RAM.

I've heard the 1.5x to 2.5x figure for swap-to-RAM for many years. I think it definitely applied in the days when most computers had 16MB or 32MB, with 64MB being a rare luxury. The apps of the day demanded more memory than that, especially when multitasking.

RAM has caught up, but apps aren't using a proportionally larger amount of if. Even running your heavyweight WM, a browser, some terminals, and OpenOffice all at once is not likely to require 1GB of RAM, let alone the 512MB + 1.5x swap that used to be a recommended minimum. Editing very large graphics might be an exception, but anyone needing such large graphics is likely to have their workstations equipped accordingly. Even then, you'd need to be dealing with in excess of 6,000x5,000-pixel truecolor images to even break 100MB.

The only other applications I can think of that might demand so much RAM would be multitrack audio editing and 3D modelling.

In short: Give a GB for swap. It can't hurt. But you probably don't need more than that.

Last edited by wapcaplet; 01-31-2005 at 05:47 PM.
 
Old 01-31-2005, 06:04 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
And if ALL else fails one can still create a swap FILE
rather than a partition (with a fair performance penalty,
one might add) ...

Code:
dd if=/dev/zero of=test.swp bs=1024 count=512000
mkswp test.swp
swapon -v test.swp
will give you a 512MB swap file ...


Cheers,
Tink
 
Old 01-31-2005, 06:31 PM   #9
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Just to put in my 2 cents...

Two of my computers have nice sized RAM for their purpose.
The Xless web/mail server:
Code:
[16:03][root@vyvyan exim]# free -m
             total       used       free     shared    buffers     cached
Mem:           759        743         15          0        142        416
-/+ buffers/cache:      184        574
Swap:         2598          0       2598
This is with 57 days of uptime, mind you.

The Dual headed X workstation, which gets multitasked a lot (ie: full screen DVD with mplayer and fullscreen pinball ):
Code:
[16:10][bulliver@virgo bulliver]$ free -m
             total       used       free     shared    buffers     cached
Mem:          1520        856        664          0        172        446
-/+ buffers/cache:       236       1283
Swap:          486          0          486
After about 6 months in this configuration (4 for the server) both computers have _never_ touched the swap. I guess my point (much like wapcaplet's) is that the higher the physical RAM, the slower the swap curve should rise. Having 3GB of swap on the workstation would be silly, as would having anything higher than 1GB on the server. Personally I wouldn't put anything more than 500MB on any computer, nor have I ever seen close to 500MB of swap used on any system I have used. The rule of thumb "swap = 2 x RAM" needs to change now that people are starting to run large amounts of physical RAM.

Those that actually read the output of free may notice a contradiction here: The reason why I have such a ridiculous amount of swap on the server, it's because I have an old quantum fireball that has served me well for many years. I didn't have the heart to retire it...so it will spend the rest of its days as a dedicated swap HDD on my server
 
Old 01-31-2005, 06:57 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
I didn't give that thing its name, and I didn't create
the swap-sapce, but have a look at this anyway ;)

Code:
 
[tink@woody ricand]$ free
             total       used       free     shared    buffers     cached
Mem:       8203228    8164892      38336          0     106220    6985532
-/+ buffers/cache:    1073140    7130088
Swap:     16578752     133304   16445448
8GB RAM and it STILL decided to swap 130MB out ...



Cheers,
Tink
 
Old 01-31-2005, 07:32 PM   #11
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
that's it. it's about the same thing. if you have more than 200 megs of ram, you won't run into many situations where swap would help much.
I have 1 Gig of RAM on my system. In the ordinary course of events, the system has ALL the 1 Gig in use, and typically between 100 and 400 Megs of swap in use as well. At this time, 999 Megs of RAM are in use (out of 1010 Megs available) and 375 Megs of swap (out of 1 Gig available).

Now, I must confess that in addition to Mandrake 10 with KDE, sendmail, mySQL, and Apache running I also have VMWare with two different Windows installations running as well. Works out pretty handy; I am doing some web integration development and I have an entire network running in this one box.
 
Old 01-31-2005, 08:07 PM   #12
bornhj
Member
 
Registered: Sep 2004
Location: Canberra, Australia
Distribution: Fedora Core 3, Ubuntu Hoary, Slack 10.1
Posts: 120

Rep: Reputation: 15
The whole RAM x 1.5 = swap thing doesn't work, because that means someone with one GB of ram would have a total of 2.5GB memory to use, while someone with 128MB RAM would have 320MB of memory to use. The way I always do my swap (in Windows and Linux) is 1.5GB - RAM = swap. This means I get a consistent 1.5GB, which is more than I ever need - I don't run many intensive programs/services under Fedora or Gentoo.
 
Old 01-31-2005, 08:17 PM   #13
dsschanze
Member
 
Registered: Aug 2004
Location: Gainesville, FL
Distribution: Linux Mint 12, Win7, iOS
Posts: 208

Rep: Reputation: 33
When I installed redhat 9 on my webserver, I gave 500megs of swap space. I think if you are going to remote GUI to it you definitely should go back and re-partition. On the other hand, if you are not using it for high performance computing as in a lab or a server, you probably can get away without it.
 
Old 01-31-2005, 08:47 PM   #14
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Quote:
Originally posted by bornhj
The whole RAM x 1.5 = swap thing doesn't work, because that means someone with one GB of ram would have a total of 2.5GB memory to use, while someone with 128MB RAM would have 320MB of memory to use. The way I always do my swap (in Windows and Linux) is 1.5GB - RAM = swap. This means I get a consistent 1.5GB, which is more than I ever need - I don't run many intensive programs/services under Fedora or Gentoo.
Your method would leave our Oracle box
with -6.5GB swap space ;}

So what you meant when you say
Quote:
The whole RAM x 1.5 = swap thing doesn't work,
is that this is not the way you do it :)

I wouldn't recommend your private formula to others,
though, but rather try and assess their needs.


Cheers,
Tink
 
Old 02-01-2005, 12:11 AM   #15
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
Quote:
Originally posted by whansard
there's a bunch of threads on this site with arguments about whether you need swap or not. using the above argument would make you believe that having 32 megs of ram with 100 megs swap is more stable than 512 megs of ram with no swap. running out of ram for applications is not worse than running out of ram+swap for applications.
This is nonsence -- the kernel for the most part throws out pages rather than swap them out. Duplications of things on the hard drive are never swapped out but rather exist on the hard drive already and are just reread. But certain types of unique generated application data is put in the swap que as soon as it is created even if it never gets swapped out. The swap is vital as a place for this data to be kept if needed and has very little to do with the hardware ram and it's paging tables, which are 4 gigs wide even if you have less ram than that. So even though the above example is absurd on the surface it's also just wrong in assuming ram and swap are related. One application (or DOS attack) that goes out of controll and gets caught in a mem allocation loop or something and all your application specific data survives in swap and your system recovers. Without swap your system crashes and all your data and important transaction or whatever is gone forever. It may of course be possible for all swap to be used up but not very likely or even possible for the same lost data results given the fact that even if an application tries to fill up swap it will have to use up ram first and in the process all vital data will be saved in swap before the app begins to use the rest of the swap and therefore only the offending process will crash and not the system.
 
  


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
Can I install linux without a swap partition? jbeedham Linux - General 26 11-16-2010 02:58 AM
How to pick the SWAP partition after install of FC4 Peanutman Fedora 9 10-27-2005 07:25 AM
Is it okay to alter swap partition with fdisk after FC4 install? Dimension User Fedora 6 09-19-2005 06:21 PM
Activating swap partition early in install Septus Linux - Newbie 3 09-10-2003 10:54 PM
RH 7.2 install and swap partition hedstrom Linux - Software 2 12-31-2001 10:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:32 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