LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 05-26-2008, 04:05 AM   #1
zero_cool666
Member
 
Registered: Jan 2006
Posts: 31

Rep: Reputation: 15
Do I need a SWAP?


Hey I'm about to install fedora 9 and um doin all the partition again.. I have a HP laptop with 2.5 G of ram.. I was wondering do I need a SWAP partition.. ?? I've heard that with that much ram SWAP is not required ... Also tell me does SWAP partition in anyway effect the suspend function..

Thanx
 
Old 05-26-2008, 04:15 AM   #2
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
It depends on how much internal memory you,re box has and the use of the system
It will works without a swap file but it can become slow
My personnel opinion have as much swap file as you,re internal memory is , to have a good performance

all the best
 
Old 05-26-2008, 04:52 AM   #3
zero_cool666
Member
 
Registered: Jan 2006
Posts: 31

Original Poster
Rep: Reputation: 15
by internel memory u mean RAM??

Also tell me that if i don't create a SWAP can I still use suspend function??
 
Old 05-26-2008, 05:11 AM   #4
SqdnGuns
Senior Member
 
Registered: Aug 2005
Location: Pensacola, FL
Distribution: Slackware64® Current & Arch
Posts: 1,092

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by zero_cool666 View Post
by internel memory u mean RAM??

Also tell me that if i don't create a SWAP can I still use suspend function??
Suspend and hibernate will need a Swap.
 
Old 05-26-2008, 05:55 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The "resume=" kernel boot option will point to your swap partition. The memory that needs to be saved is saved to the swap file.

Hard drive space is cheaper than ram space so there shouldn't be so much of a problem. If you can do without hibernation, then you could add a very small swap partition but some software may assume there is at least some.
 
Old 05-26-2008, 06:14 AM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I never heard of a computer becoming slow without because it doesn't have swap space. Why would it? Swap spaces is a kind of 'overflow' memory and behaves exactly like that, but much slower. So if you are out of RAM, the MMU will start to use swapping memory pages to disk, which is compared to RAM access a very slow process. In case you have sufficient memory, no swap space is being used at all, let alone the computer becomes slow.

If the kernel is out of memory (RAM + swap) it will start killing processes using memory in order to be able to keep running itself. Only in that abnormal situation the computer seems to hang for a while.

Linux running KDE uses about 500 MB of RAM. With 2.5 GB you would not need swap space. However when you start running memory hungry processes and virtual machines, this amount increases quickly. Just for the sake of it is common practice I am running 2 GB swap space on my 2 GB RAM laptop.

I don't hibernate as booting is faster than reloading 2 GB RAM from disk. Strange but true.

jlinkels

Last edited by jlinkels; 05-26-2008 at 06:15 AM.
 
Old 05-26-2008, 10:31 AM   #7
zero_cool666
Member
 
Registered: Jan 2006
Posts: 31

Original Poster
Rep: Reputation: 15
hey thanx jlinkels Ur tip really helped..
 
Old 05-28-2008, 11:44 PM   #8
harsshal
Member
 
Registered: Jul 2006
Location: New York, NY
Distribution: redhat,ubuntu,RHEL,fedora,centOS
Posts: 105

Rep: Reputation: 15
this might help you.

http://www.redhat.com/docs/manuals/e...swapspace.html
 
Old 05-29-2008, 08:43 AM   #9
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by jlinkels View Post
I never heard of a computer becoming slow without because it doesn't have swap space.
Shortage of swap space can, and often does, significantly slow down a system, even when there is enough RAM+swap to get all the work done without killing processes.

Quote:
Why would it? Swap spaces is a kind of 'overflow' memory and behaves exactly like that, but much slower. So if you are out of RAM, the MMU will start to use swapping memory pages to disk,
That is too simplistic a view of the interaction between available ram space and disk I/O. There are at least three other ways available ram reduces disk I/O (and/or shortage of ram increases disk I/O) and for each of those, a shortage of swap space can increase disk I/O, slowing down the overall performance.

1) File caching. That can make a massive difference in performance. If the system is short of RAM+SWAP, it will cut way back on file caching before it reaches the level of killing processes. Too little file caching can cause a large increase in physical disk I/O.

2) I don't know the name for it, but Linux can page read-only sections of executables and .so's directly from the binary file on disk. When it "pages out" such read-only content, it doesn't need to write to the swap file, instead it just drops the ram copy. To "page in" it just rereads from disk. If the system is short of RAM and RAM is in use both by RW content from some sleeping process likely not to need it again for many minutes and RO content from a running process that will need it again a fraction of a second later, would you prefer the system write the stale RW pages to swap and have enough RAM to continue, or would you prefer it drop some active RO pages and then a fraction of a second later need to drop some different active RO pages to read the first ones back and so on? If you're also short of SWAP, the OS has no choice.

3) Memory mapped file I/O: Same discussion as for (1) but for a different way that some applications do file I/O.
 
  


Reply



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
swap file vs. swap partition verndog Ubuntu 16 07-09-2012 08:49 PM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM
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

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

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