LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-09-2015, 02:48 AM   #16
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73

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.
 
Old 06-09-2015, 08:22 AM   #17
gombi
LQ Newbie
 
Registered: Jun 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by robertjinx View Post
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.
 
Old 06-10-2015, 12:51 PM   #18
gombi
LQ Newbie
 
Registered: Jun 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
I just got a new spike but not enough to start OOM.

Why is mem usage going down and swap usage is going up?

http://i.imgur.com/PyT35ie.jpg

Left side is before the spike. Right side is just 5 minutes later.

http://pastebin.com/AmSxhVJC
 
Old 06-10-2015, 01:10 PM   #19
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Quote:
Originally Posted by gombi View Post
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.
 
1 members found this post helpful.
Old 06-10-2015, 02:44 PM   #20
gombi
LQ Newbie
 
Registered: Jun 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by joec@home View Post
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.
 
Old 06-10-2015, 03:14 PM   #21
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Quote:
Originally Posted by gombi View Post
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.
 
1 members found this post helpful.
Old 06-10-2015, 03:42 PM   #22
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 gombi View Post
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.
 
1 members found this post helpful.
  


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
Understanding the out-of-memory state and the oom-killer SCBrisbane Linux - Kernel 2 12-21-2012 05:53 AM
OOM killer even though there is memory available Bilb Linux - General 4 12-07-2011 03:03 AM
Out of memory (oom) killer causes system crash? BusyBeeBop Linux - Software 6 06-02-2008 01:42 AM
what process is allocating memory and causing oom-kill? thormk Linux - Server 3 04-22-2008 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:40 PM.

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