Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-22-2007, 06:34 AM   #1
Registered: Jun 2006
Location: Galway
Distribution: Suse 10.1
Posts: 114

Rep: Reputation: 15
how much swap space is needed; how to increase swap space?


As a rule of thumb, how much swap space should you have? I read different values in different places...

I'm running a fairly large code at the minute and I'm getting a segmetation fault...I know where the crash is happening and it has been suggested that it might be because I have insufficient swap space...but I don't see how that can be.

I have 3Gb of RAM and 1Gb of swap space...I monitor the memory usuage using top and it never really exceeds about 40% of total...

although maybe I'm missing something and I do need more swap space? Would be nice if this sorted the seg fault...wishful thinking!

Old 03-22-2007, 06:50 AM   #2
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,243

Rep: Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382
Don't think it'll help in this case (40% ), but it's as simple as creating new partition(s)/file(s) and mkswap/swapon.
I keep a couple of spares around just in case. Add them as I need them (obviously, mkswap only needs to be run once each).
Old 03-22-2007, 07:10 AM   #3
Registered: Feb 2005
Location: SoL iii
Distribution: Mandriva 2007
Posts: 110

Rep: Reputation: 15
if you never exceeds about 40% of total swap, so for you 1Gb should be ok. typically the guides said your swap should be twice as big as your RAM, but that was back when normal amount of RAM was in the 2Mb - 256M interval...
I would suggest you:
1.reformat you swap partition.
2.create and other (1Gb) swap partition (better in other hdd, closer to the beginning of the disk)
3.add the new swap partition to /etc/fstab

that should put you in the safe side. =)

for doing that you can use gparted or a similar (many distros has similar tools included).
Good Luck!
Old 03-22-2007, 08:15 AM   #4
Registered: Jun 2006
Location: Galway
Distribution: Suse 10.1
Posts: 114

Original Poster
Rep: Reputation: 15
thanks for that.

I went for a swapfile - seemed easier!
Old 03-22-2007, 09:22 AM   #5
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
if you run "free" it will tell you how much of your swap is being used. Obviously it should show no swap space available if you need more of it. Probably you've got most of that gig available.

Last edited by lurko; 03-22-2007 at 09:23 AM.
Old 03-23-2007, 04:20 AM   #6
Senior Member
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,606

Rep: Reputation: 53
google for swappiness linux as well
and see if increasing it helps
Could be interesting
decrease it for faster performance


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
how to reduce swap space and reclaim the space grantm Linux - Newbie 7 08-16-2012 08:05 AM
How do I increase my swap space on RH Linux AS 4.0 pdillard Linux - Software 3 01-19-2007 03:37 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 02:23 AM
How to increase SWAP partition space ? sureshsaragadam Linux - Newbie 23 10-01-2003 10:24 AM
Increase Swap Space? star geezer Linux - Software 9 03-10-2003 01:04 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:20 AM.

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