how much swap space is needed; how to increase swap space?
Linux - NewbieThis 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!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
how much swap space is needed; how to increase swap space?
Hi.
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!
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).
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.