Review your favorite Linux distribution.
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 11-30-2011, 08:05 AM   #1
LQ Newbie
Registered: Aug 2009
Posts: 22

Rep: Reputation: 0
Problem with swap space

Hello Folks ,

I am facing a problem ,my swap space is not working on my system.even when i am using heavy process and services.

root@Troy:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick

root@Troy:~# free -m
total used free shared buffers cached
Mem: 1001 979 21 0 51 645
-/+ buffers/cache: 282 719
Swap: 4290 0 4290

cat /etc/fstab
# /etc/fstab: static file system information.
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=7c6e437d-fcee-4182-a887-5c3d89b570f8 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=bb76de4b-32db-42dc-8672-ff90fc2444fc none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

root@Troy:~# blkid
/dev/sda1: UUID="7c6e437d-fcee-4182-a887-5c3d89b570f8" TYPE="ext4"
/dev/sda5: UUID="bb76de4b-32db-42dc-8672-ff90fc2444fc" TYPE="swap"

root@Troy:~# swapon -s
Filename Type Size Used Priority
/dev/sda5 partition 4393980 0 -1

please help me in this, UUID for swap is correctly mapped into fstab inspite of that Swap doesnt start working.

Please help.

Last edited by arvindk.monu; 11-30-2011 at 08:06 AM.
Old 11-30-2011, 08:34 AM   #2
Registered: Jan 2010
Location: Velveeta, USA
Distribution: Xen, Gentoo,Ubuntu,openSUSE,Debian,pfSense
Posts: 98

Rep: Reputation: 8
1GB is still a lot of RAM, most of the new Android devices come with less than that.
I have a 2GB system that doesn't swap.

Your /etc/fstab looks correct and swapping is on.

Use top, or htop to see which apps are using memory and how much.

as an experiment, you could
cat /proc/sys/vm/swappiness
see what that says, save the echo'd value to restore later.

echo 100 > /proc/sys/vm/swappiness #(100 is max)
see how swapping behaves after that.
If swapping works when needed, and you have no performance issue what are you worried about?
Old 11-30-2011, 08:49 AM   #3
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
Originally Posted by arvindk.monu View Post
I am facing a problem ,my swap space is not working on my system.even when i am using heavy process and services.
I don't see any problem in those numbers. I think you are simply misunderstanding the reasons a Linux system uses swap space and expecting use of swap space when the system has not needed any.

Originally Posted by _bsd View Post
as an experiment, you could ...
I wouldn't bet that experiment would produce any informative results and if it happened to produce such results, I'd bet against the OP understanding those results.

Given "memory pressure", which might or might not exist in the OP's system, Linux might displace certain kinds of memory use that can be read back later from the same file it came from originally. That is an important activity very similar to what a user thinks of as swapping, but it doesn't use any swap space.
Alternately, Linux might displace other kinds of memory use out to swap space.

Which of those it will do depends on which kind of memory use is present but not recently accessed. Swappiness affects that decision (which of those two kinds of memory to displace) in borderline cases where the two are roughly equal). A normal Swappiness value makes Linux prefer (in borderline cases) to displace memory use that doesn't take swap space. Swappiness 100 makes it treat the two equally, which is a bad idea, because displacing memory use back to the original file is in the long run half as expensive displacing memory to swap.

If none of the uses of "anonymous memory" are "stale" then changing swappiness would have no effect. Linux might choose to displace the kind of memory use that goes to the original file even if it is making the decision on an equal basis.

Last edited by johnsfine; 11-30-2011 at 09:04 AM.
Old 11-30-2011, 08:14 PM   #4
LQ Newbie
Registered: Aug 2009
Posts: 22

Original Poster
Rep: Reputation: 0
Thanks johnsfine,_bsd it start using swap space when i start heavy numerous process to small extent..i think my understanding to swapping was wrong,i was thinking unused pages from RAM to swap space whether RAM is not fully occupied(not using 100%),but in current scenario it seems to me swap space is only used when RAM become full.if you guys can enlighten some more information this i will be very thankful to you.
Old 11-30-2011, 08:58 PM   #5
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,781
Blog Entries: 17

Rep: Reputation: 3313Reputation: 3313Reputation: 3313Reputation: 3313Reputation: 3313Reputation: 3313Reputation: 3313Reputation: 3313Reputation: 3313Reputation: 3313Reputation: 3313
My understanding is that Linux swaps only when it needs to; if it doesn't need to, it won't. The more RAMs, the less swapping.

The one I'm using right now has 4 GB RAM and is not swapping at all.

Here's one interesting article I found:


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
Swap Space Problem bellskar Linux - General 6 09-19-2010 02:41 PM
Problem with swap space dwhitney67 Linux - General 4 10-08-2007 06:20 PM
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 04:20 AM
swap-space fstab problem MarkGraham Linux - Newbie 3 12-06-2002 12:23 PM
swap-space fstab problem MarkGraham Linux - Newbie 0 12-05-2002 08:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration