Why swap space did not function when physical memory ( RAM ) is full ?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
swap memory is not using so far i understood because,
current swap used: 108.00k is remain unchanged from the very beginning. Can i use both memory in parallel.
swap memory is not using so far i understood because,
current swap used: 108.00k is remain unchanged from the very beginning.
That doesn't mean it isn't being used or isn't functioning. It just means the amount that has been used was used before you noticed.
Quote:
Can i use both memory in parallel.
You should understand that swap space is so much slower than ram that you want to use ram as much as possible and only use swap space when that use makes room in ram for something more important. That is exactly what is already happening on your system.
You should also understand that only certain kinds of memory contents require the use of swap space to remove them from ram. Quite a lot of ram is occupied by executable code and other contents that are still associated with the files they were loaded from. If any of that content must be removed from ram to make room for other things, Linux does not need to write that to swap. Instead it simply discards the copy in ram, knowing that it can reload from the original file later.
Because that discard/reload sequence typically costs only half the disk access time of write/read-back to swap, Linux is biased in favor of dropping contents that don't need swap, rather than contents that do need swap. So in a system with a light memory load (which yours is, despite ram being "full") swap is typically used only for data that is created as a side effect of service processes starting (and isn't really needed for continuing operation of those processes). Once the cache fills up the ram, that stale data from service processes gets swapped out, then never comes back in (except maybe for a moment during shutdown of those services).
But typically, everything else you do with the kind of content that could be swapped is short lived or recent enough compared to cache that it is not productive to swap it out. So as you saw, the amount of used swap space isn't changing.
Quote:
Originally Posted by TobiSGD
Please post the output of
Code:
free -m
between code-tags.
That info would tend to confirm what we already know about the situation in the OP's memory use. I'm sure there would be no surprise there.
Quote:
Originally Posted by pan64
You can use swap of course, but you cannot force your os to use swap if it does not need it.
Sure you can. First you adjust the swappiness parameter so Linux is no longer biased in favor of dropping cache and against using swap space. Next you run some activity that reads a lot of files, making the file cache content in ram newer than the anonymous data of all your other processes. Result: the anonymous data of all your other processes will be pushed out to swap, even though the os doesn't "need" to keep so much in cache and likely wouldn't keep so much in cache if swappiness were tuned correctly. Of course that would be a stupid thing to do.
That info would tend to confirm what we already know about the situation in the OP's memory use. I'm sure there would be no surprise there.
The point is that we know nothing about the memory use besides what the OP states he thinks is the memory use. So the output of free will show us what really is happening.
The point is that we know nothing about the memory use besides what the OP states he thinks is the memory use. So the output of free will show us what really is happening.
I didn't want to make a fight out of that. I just didn't want the OP to think that the answer will change after we see output from free.
We know there is plenty of ram and it is almost all "used". We know there is plenty of swap space and a very small unchanging amount of that is used.
From those we can infer quite a lot. We can infer that free would tell us that a lot of ram is used by buffers and cache. The LinuxAteMyRam link has already explained that the large amount of ram "used" by buffers and cache is effectively free.
If there were not a large amount of ram effectively free, then the swap usage would be larger and varying.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.