Out of memory (OOM killer) - what is causing my memory issue?
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.
You can also try to use vm.dirty_ratio = 40 or vm.dirty_ratio = 50 and it might help with the reclaim, I can't guarantee, but it might. Try also setting vm.min_free_kbytes to 65536 not 45056, this also will force the kernel to free up a bit more memory which in terms will trick it to actually have memory. Hope it helps.
You can also try to use vm.dirty_ratio = 40 or vm.dirty_ratio = 50 and it might help with the reclaim, I can't guarantee, but it might. Try also setting vm.min_free_kbytes to 65536 not 45056, this also will force the kernel to free up a bit more memory which in terms will trick it to actually have memory. Hope it helps.
Thank you Robert. I will try that and see how it goes. For the moment all is ok and system is running for a few days and still not swapping.
Why is mem usage going down and swap usage is going up?
That is how swap works. Imagine having two cups, one being filled with water from time to time and the other is empty. When one cup gets near full, pour some of it into the second cup. The first cup then has less water in it.
That is how swap works. Imagine having two cups, one being filled with water from time to time and the other is empty. When one cup gets near full, pour some of it into the second cup. The first cup then has less water in it.
That’s a good point Joe. Got that now.
I still don’t understand the sudden need to swap that much.
I still don’t understand the sudden need to swap that much.
A little more detailed info in that memory is set in blocks, and then those blocks will be assigned to processes. It take time to move from RAM to disk and during the transition the related blocks will most often be locked out from the process. Bear in mind a single process might be assigned many blocks, not simply one, and it is better to have all the blocks in either RAM or swap, not split between the two. The simplest way to track this with the least interruptions to the overall system is to find the process that has the largest number of blocks assigned to it and move those blocks to swap. Thus a large amount of RAM is freed up in one single large move operation rather than a bunch of smaller move operations.
Why is mem usage going down and swap usage is going up?
The flow from swap to ram is not driven by the mere availability of free ram.
So if there is a temporary need to swap and that need goes away, then you see exactly what you did see: Swap use goes up, then before the next time you sample ram use goes down and swap use stays up.
So any short lasting new load on ram will cause that long lasting increase in swap use and decrease in ram use that you observed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.