Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-05-2003, 11:26 PM   #1
LQ Newbie
Registered: Jul 2003
Location: NY
Distribution: debian and others
Posts: 14

Rep: Reputation: 0
swap space

Will someone tell me a bit more about swap space? I'm worried that my Redhat runs slowly (on my fast-ish computer) because of my lack of slack space. Any ideas? I sort of want to try and play the super-duper starfighter game, not to mention Tux Racer!
Old 07-06-2003, 12:14 AM   #2
LQ Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Swap space is an emergency solution when you overload ram. Swapping turns a catastrophic failure (ram is full) into a major nuisance (system runs very slow).

When you start more programs than will fit into ram then Linux starts swapping data out to the swap partition. When that info is needed again Linux swaps it back into ram. Swapping is extremely slow. When you start swapping the solution is not to add more swap space on your disk. The solution is to either buy more ram or to run fewer programs at the same time.
Old 07-06-2003, 12:36 AM   #3
Registered: May 2003
Location: S.W. Ohio
Distribution: Ubuntu, OS X
Posts: 760

Rep: Reputation: 30
Run top in a terminal window. It will show how much ram is being used and also how much of your swap is being used.
Old 07-06-2003, 10:12 PM   #4
Registered: Jul 2003
Posts: 73

Rep: Reputation: 15
How much memory do you have ? The swap space should be at least equal to that (some suggested twice of your memory). Pu the swap space on its own partition
Old 07-11-2003, 02:43 PM   #5
Registered: Oct 2002
Location: Malaysia
Posts: 106

Rep: Reputation: 15

I have tried with the free command and below is my result :

total used free shared buffers cached
Mem: 514464 464072 50392 0 49440 140540
-/+ buffers/cache: 274092 240372
Swap: 2048216 0 2048216

Strange thing is that the swap is not being used.Any idea why this is happening?WE have also just added 256MB ram to the server and its been used up to 464072 as you can see.


Old 07-11-2003, 03:24 PM   #6
LQ Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
When a cache buffer or a program is no longer unused Linux does not free up the memory. Linux keeps the buffer or program in case it is ever needed again.

When a new memory request comes along Linux first tries to satisfy the request from memory that has never been used, then from memory that has been used but is now unused, and as a last resort it moves some active memory out to the swap partition to free up some memory for the new request.

The free command does not distinguish beteen memory that is actively being used and old memory that is being saved in case it is ever needed again. So if you issue a free command at boot it will show some free memory. After a while the free command will show all memory being used.

The way to tell if you are short of memory is to watch to see if Linux ever actually does any swapping.


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 On
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
swap space alphisb0t Linux - Software 1 07-05-2004 04:16 PM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 02:23 AM
swap space not being used bishal Linux - Software 16 05-07-2004 01:28 AM
Swap Space bawbag Slackware 6 07-16-2003 11:59 PM > Forums > Linux Forums > Linux - General

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