LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-29-2010, 01:04 PM   #1
gn669
LQ Newbie
 
Registered: Nov 2010
Distribution: Slackware
Posts: 7

Rep: Reputation: 0
no swap usage - Slackware 13


I'm using slackware about a month now and two days ago I checked to see the usage of my RAM and I saw that there was no swap...no used, no total....nothing!!!!(how can this be?)
swap -s returned nothing, I checked fstab and there was swap there so I entered the line about swap " UUID=6ea9269a-6bf7-4486-b481-a54dd3bde314 none swap sw 0 0",i believe it' s correct.
I checked after restart with "free" and the total was ok but used is 0. I copied about 5 GB to see what would happen and still nothin... RAM was nearly full but still no swap used!!!
any ideas???????
 
Old 11-29-2010, 01:18 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I found your post very hard to understand, so I guessed at much of what you meant.

Quote:
Originally Posted by gn669 View Post
I saw that there was no swap...no used, no total.
No used could have lots of reasons. No total (if I understand what you mean) indicates the swap was somehow setup wrong (such as something wrong in fstab).

Quote:
I checked fstab and there was swap there so I entered the line about swap " UUID=6ea9269a-6bf7-4486-b481-a54dd3bde314 none swap sw 0 0",i believe it' s correct.
I don't understand. Probably don't need to. Is the bottom line of that you found and fixed what was wrong with swap in fstab?

Quote:
and the total was ok
Total "OK" as in confirmation that your correction to fstab worked?

Quote:
but used is 0.
That still may be normal behavior. There is a correct bias in favor bumping out non anonymous memory (not using swap) when there is memory pressure.

In a system with excess physical ram, that is also well (or default) tuned, it may be very hard to get swap used soon after rebooting. Swap should be used for stale portions of anonymous memory in processes that have been sitting around for a long time. If no processes have been sitting around long enough, the stale anonymous memory isn't stale yet.

Quote:
RAM was nearly full but still no swap used!!!
any ideas???????
RAM nearly full may have no real significance. You may still have a major excess of ram and not enough memory pressure to cause any swapping. The cache can hold onto almost anything ever touched from the file system and can fill up easily. But the OS will know it is better to drop unimportant cache use in preference to writing anything out to swap.

Maybe you have swapiness set too low or have some other non default mis tuning or other problem stopping a legitimate use of swap. But I wouldn't lean toward that theory based on what you have said. More likely, since fixing the fstab error you haven't used the system in any way that makes use of swap preferable to dropping some of the cache.

Last edited by johnsfine; 11-29-2010 at 01:21 PM.
 
1 members found this post helpful.
Old 11-29-2010, 02:03 PM   #3
gn669
LQ Newbie
 
Registered: Nov 2010
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: 0
yaeh sorry about that but I 'm not really used to speak or write in english!!!Yes i mean that "swapon -s" returned the corrent amount of swap partinion.To tell you the truth Im a bit confused about linux(it takes tiiiiiiiime)!Isn't swap the equivalent to virtul memory in Windows.as far as i know windows use an amount of virtual memory all the time(my system does anyway) and i assumed is the same here!My ram is 2GB and swap is 4GB more or less!so you are saying that there is not much load for the system to use swap, right?I thought maybe there was something else I had to right in fstab, maybe change an option!

Last edited by gn669; 11-29-2010 at 02:08 PM.
 
Old 11-29-2010, 09:04 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Linux does not use the swap partition unless it needs to. It's not like Windows, which always creates and uses a swap file (pagefile.sys if I remember correctly).

I have four gigs of RAM in this box. I just checked my swap partition; it's not being used right now, because I haven't done anything intensive to require it to be used.

And, yes, Linux takes a little time. There is a learning curve, but remind yourself how much time to spent learning That Other Operating System(tm). I am very good at Windows, at least up through XP, and I can attest that, after the learning curve, Linux is easier.
 
Old 11-29-2010, 09:21 PM   #5
fbsduser
Member
 
Registered: Oct 2009
Distribution: Hackintosh, SlackWare
Posts: 267

Rep: Reputation: 30
0 of swap usage is normal most of the time. Linux, unlike that resource hog called Windoze, is pretty smart about memory usage.
 
Old 11-30-2010, 07:07 AM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by gn669 View Post
Isn't swap the equivalent to virtul memory in Windows.
No. Swap in Linux is roughly equivalent to "paging file" in Windows. Swap holds "anonymous" pages that have been pushed out of physical ram because the need for that physical for other purposes was estimated by the OS as more important. (Which pages are "anonymous" is another complicated discussion).

Quote:
as far as i know windows use an amount of virtual memory all the time(my system does anyway) and i assumed is the same here!
Memory management is a more complex topic than most users understand. As far as I know, Windows intentionally misrepresents memory management statistics to provide numbers that won't look unreasonable to an ordinary user (but tend not to give useful information to anyone). Linux tools for reporting memory use give info that is closer to the underlying reality and thus more useful to an expert, but generally misunderstood by ordinary users.

Windows often and Linux very rarely will depend on having swap space without actually using that swap space (because of another complex topic called "over commit"). I believe that under those conditions Windows will report more pagefile space in use than is actually in use but less than is required to exist. So it might need a lot to exist, but be using zero, but report it is using a little. In the much less common case that Linux needs swap space without actually using it, the correct level of use will be reported (meaning zero use if it isn't actually using any).

On a system with 2GB physical ram, a single very large application might push the system up to the level that it needs swap space to exist, while staying below the level of actually using swap space. I assume you were not running any such application while your swap space was disabled (if you had, that application would have aborted). You probably still aren't running any such application.

Actually using the swap space (as opposed to needing it to exist) is more likely if you open a bunch of applications and then leave them open but idle while you use the computer for something else.

Last edited by johnsfine; 11-30-2010 at 07:23 AM.
 
Old 11-30-2010, 11:36 AM   #7
gn669
LQ Newbie
 
Registered: Nov 2010
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: 0
I see!!!thanks for the replies you were very helpfull.you saved me a lot of time.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Swap Usage Kristijan AIX 3 04-24-2007 02:17 AM
ram and swap usage? FredericV Linux - General 6 03-25-2007 04:56 PM
How much swap usage is too much? sneakyimp Linux - Hardware 3 11-30-2006 04:48 PM
swap usage pingvina Linux - Software 4 02-24-2006 12:52 PM
Swap Usage ComputerErik Slackware 3 05-06-2005 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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