Latest LQ Deal: Linux Power User Bundle
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 08-28-2002, 04:07 PM   #16
Registered: Feb 2002
Location: Virginia USA
Distribution: Slackware, CentOS, Fedora
Posts: 342

Rep: Reputation: 30

Originally posted by Xreagan
Is their some command I can use to check available swap though?
You can try top
Old 08-29-2002, 07:36 AM   #17
Registered: Aug 2002
Distribution: RedHat / Debian / Ubuntu
Posts: 35

Rep: Reputation: 15
First, try "free -m", which will, on the last line, tell you how much swap there is in the first column, and how much is used/free.

If there is 0 total, then you *do* have a problem. If there is some, but Linux isn't using it, then you have no problem. (Feel free to force it to swap by writing a small C program which allocates and locks memory.)

Your fstab seems to be right, so try the following until "free -m" seems to be telling you that you have some swap available.

swapon -a
# This should "mount" the swap partitions. Check it with free -m again.
swapon /dev/sdd1
# Or whatever your swap partition is. Again, check afterwards. This
# command may give you useful errors.
swapoff -a ; mkswap /dev/sdd1 ; swapon /dev/sdd1
# Replace /dev/sdd1 with your swap partition, as above. If this works, try
# the following:
swapoff -a ; swapon -a
# If you have available swap by the time you get here, your problems
# ought to be sorted. Otherwise, you've got an "interesting" problem.
Old 08-29-2002, 07:40 AM   #18
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
And d00d, it would appear that it is in fact installed correctly.

free will tell you a bit about your RAM and swap. If you want to learn more about swap you can read the man pages associated with it.

I would hope that you are not getting upset about this. We are just trying to help you, and show you that Linux can work with your system well, and does not eat at RAM to the point of needing a SWAP very often. Please understand, we are trying to sort of "look out for your best interests" and this may seem like it's not helping you, but in fact it is.

But it looks like now you should read up on the man pages associated with swap. It does appear that you do have swap setup if it ever does need to be used.

Old 08-29-2002, 01:00 PM   #19
LQ Newbie
Registered: Aug 2002
Posts: 15

Rep: Reputation: 0
I've never used free, but as I recall there is also the 'mem' command which will give you a pretty complete picture of your memory.

Linux really does not make much use of swap, at least in my experience on a single-user machine. About 5 years ago, I tried this out. On a 24M machine, I looged in on each console, ran Motif (K and GNOME were just a twinkle in my eye then), ran several types of processes, including graphics intensive ones, and found that Linux was barely using any swap at all.

I think much of this is due to things like shared libs and reentrancy. Linux does make much more intelligent use of swap.

I have heard that the general rule of setting swap to twice your RAM can be a fallacy, but I don't really know enuf to say one way or another. However, you should at least use SOME swap, in my opinion.
Old 08-29-2002, 01:47 PM   #20
Registered: Aug 2002
Distribution: RedHat / Debian / Ubuntu
Posts: 35

Rep: Reputation: 15
"mem" is DOS, if I recall. Doesn't exist on my box, anyway. Although it does exist on Windows 2000, still giving out the DOS output.

For comparison, my "router" (which also does mail and web serving, and sometimes runs squid) uses about 100M out of 256M physical, and no swap at all - although, of course, it has some available.

My workstation, which has 768M, and runs RawHide (Gnome 2, etc), uses about 150M of swap nearly all the time, and about 381M physical. It's got "only" 1G of swap, thus breaking the "twice the memory" rule.

Remaining physical memory on both is all used by caches and buffers, except for the 7M spare space.

My first Linux box, a monstrous 40M beast running 1.1.59 - about 7 years ago, used a bit of the 128M of swap it had available. But then, it was running a 150 user BBS, amongst other things. And I should have made that a *lot* more memory conservative.

Incidentally, the "twice the memory" rule used to be "four times the memory", back in the day, and applied equally to Linux and Windows, even though Windows (at the time, certainly, an possibly still) had all sorts of operating system services designed to aid minimum use of "virtual memory".


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 partition Mojojo Linux - Hardware 10 01-20-2005 06:12 PM
Newbie Installing Debian3 on m68k w/250M Partition Needs help creating swap partition AppleMac Linux - Newbie 2 11-01-2002 09:45 AM
Should I be using a SWAP partition? Gene126 Linux - General 3 08-14-2002 10:03 PM
swap.partition anoop_chandran Linux - General 3 12-28-2001 10:48 AM
Swap partition Thomas_Delrue Linux - Newbie 3 07-12-2001 09:35 PM > Forums > Linux Forums > Linux - Newbie

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