Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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???????
I found your post very hard to understand, so I guessed at much of what you meant.
Quote:
Originally Posted by gn669
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.
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!
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.