LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-05-2003, 10:26 PM   #1
wdavidson
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-05-2003, 11:14 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
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-05-2003, 11:36 PM   #3
twilli227
Member
 
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, 09:12 PM   #4
aherrys
Member
 
Registered: Jul 2003
Posts: 85

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, 01:43 PM   #5
andy18
Member
 
Registered: Oct 2002
Location: Malaysia
Posts: 106

Rep: Reputation: 15
Hi,

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.


THanks


Andy
 
Old 07-11-2003, 02:24 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:41 AM.

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