You are not logged in.

#1 2007-11-27 15:41:31

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Swap not being used?

Hi, it seems to me that my swap is not really working, is that normal at all?

free -m
             total       used       free     shared    buffers     cached
Mem:           503        495          7          0          7        153
-/+ buffers/cache:        334        168
Swap:         2996          0       2996

Now this is my fdisk -l /dev/sda:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1824    14651248+  a5  FreeBSD
/dev/sda2            1825        3648    14651280   83  Linux
/dev/sda3            3649        9729    48845632+   5  Extended
/dev/sda5            3649        3830     1461883+  82  Linux swap / Solaris
/dev/sda6            3831        9347    44315271   83  Linux
/dev/sda7            9348        9729     3068383+  82  Linux swap / Solaris

And the swap for my current partition is on /dev/sda7.

Here is my /etc/fstab entry for /dev/sda7:

/dev/sda7 swap swap defaults 0 0

I have also tried to issue:

swapoff -a
/sbin/mkswap /dev/sda7
swapon -a

recreating the swap, but it's still the same...

Let me add this:

cat /proc/sys/vm/swappiness 
60

Thanks for your time smile

Last edited by finferflu (2007-11-27 15:48:47)


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#2 2007-11-27 16:13:00

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Swap not being used?

Thats seems about right... actually you've got a TON of space dedicated to swap.  I have 2GB of ram and my swap has never been used--except for suspend2ram which requires as much space as you have RAM. 

I finally removed the swap status from conky because it was always 0%.

I have 2GB dedicated to swap, but realistically I could've gotten away with 256MB or less if I didn't need to suspend my notebook.

Other than suspending to RAM, swap should only get used in a worst case scenario when you run completely out of RAM.

Last edited by thayer (2007-11-27 18:11:51)


thayer williams ~ cinderwick.ca

Offline

#3 2007-11-27 16:19:29

stonecrest
Member
From: Boulder
Registered: 2005-01-22
Posts: 1,190

Re: Swap not being used?

You still have 200mb of ram free (free+buffers+cached), so yes, you're not going to swap. Load a bunch more programs if you want to see swapping.


I am a gated community.

Offline

#4 2007-11-27 16:24:13

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Swap not being used?

WOW, to see it swapping I had to open: Firefox, Epiphany, Opera, Kazehakase, OpenOffice, Gimp, and Inkscape at the same time.
I have noticed that obviously the system was locking up, should I set the swappiness to swap a bit earlier?
I don't know much about swap.

As for the size, I have 1GB, since I have always read that it should be double the size of my RAM.

Thank you both for your replies smile


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#5 2007-11-27 16:33:22

shen
Member
Registered: 2003-09-05
Posts: 272
Website

Re: Swap not being used?

I don't even use swap. I have 2 gig of ram and even when compiling large packages I never use all my ram. I can easily setup a swap file if I need to but have not needed it so no point.

Offline

#6 2007-11-27 16:54:12

phildg
Member
Registered: 2006-03-10
Posts: 146

Re: Swap not being used?

You want to keep the use of swap minimal, remember hdd access is much slower than memory access. Recommendations for swap vary depending on os, I'm unsure what they are for Linux except that over 512Mb is overkill, for FreeBSD it is 2 - 3 times the amount of memory.

Offline

#7 2007-11-27 17:55:31

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Swap not being used?

Remember that pm-utils use swap area for it's resume image, thus you need at least RAM size + some additional swap, in case you plan to hibernate your computer some day.

Last edited by pelle.k (2007-11-27 17:55:50)


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#8 2007-11-27 18:08:54

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Swap not being used?

@pelle.k: Right! That's why I kept my swap! I haven't been able to suspend for a while now because of the ATI fglrx issues so I had completely forgotten about it.


thayer williams ~ cinderwick.ca

Offline

#9 2007-11-28 00:18:54

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Swap not being used?

Thanks people for your tips smile


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

Board footer

Powered by FluxBB