Results 1 to 10 of 12
Let me first start out by giving you my server specs. I am running a server with 8gigs of ram, NO hard drive, and no swap space. The servers periodically ...
- 02-23-2009 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 26
Running out of Memory
Let me first start out by giving you my server specs. I am running a server with 8gigs of ram, NO hard drive, and no swap space. The servers periodically run out of memory, OOM panic. Top shows < 20000k free memory but there is plenty of buffer and cache memory, >800mb. It was my understanding that the system would not run out of memory if there was cache and buffer space? Can somebody explain this to me? Thanks
- 02-23-2009 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
Individual threads/processes do not have unlimited memory. The limits are also different for 32 vs 64 bit OS'es.
Also, what do you have running? The most common cause of OOM errors is a memory leak in an application.
- 02-23-2009 #3Just Joined!
- Join Date
- Mar 2008
- Posts
- 26
but I'm only getting OOM panics when system memory goes below 20mb. Isn't the kernel supposed to free up the cached and buffer memory so that it can bused for apps?
BTW its a 64 bit OS.
- 02-23-2009 #4Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
No. If the thread has its max memory, no more can be addressed/allocated.Individual threads/processes do not have unlimited memory.
- 02-23-2009 #5Just Joined!
- Join Date
- Mar 2008
- Posts
- 26
Its not any specific thread but random threads that get killed. It only happnes when top shows less than 20mbs of free system memory.
- 02-23-2009 #6Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
You have memory problems. When memory gets low, Linux will "pick" processes to kill based on a "badness" score.
OOM Killer
The processes getting killed are not the problem, they are a symptom of the problem.
** Edit: Process getting killed is *not necessarily* the problem process.The functions, code excerpts and comments discussed below here are from mm/oom_kill.c unless otherwise noted.
It is the job of the linux 'oom killer' to sacrifice one or more processes in order to free up memory for the system when all else fails. It will also kill any process sharing the same mm_struct as the selected process, for obvious reasons. Any particular process leader may be immunized against the oom killer if the value of it's /proc/<pid>/oomadj is set to the constant OOM_DISABLE (currently defined as -17).
The function which does the actual scoring of a process in the effort to find the best candidate for elimination is called badness(), which results from the following call chain:
- 02-23-2009 #7Just Joined!
- Join Date
- Mar 2008
- Posts
- 26
I guess my point is, why is linux not freeing the buffer and cache memory?
- 02-24-2009 #8Just Joined!
- Join Date
- Mar 2008
- Posts
- 26
No ideas or explenations on why linux is not freeing up the buffer and cache memory when system memory goes below 20mb? If I decrease the swappiness value, even though I am not using swap space, will this reduce the amount of memory uses for cache?
- 02-24-2009 #9Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
Based on not having any idea of what is causing the low memory condition (the actual problem), I don't see any reason to guess that "buffer/cache is not being released correctly."
- 02-24-2009 #10Just Joined!
- Join Date
- Mar 2008
- Posts
- 26
Then why would top show 2 gigs of cache and buffer memory combined when it crashes?
What about the swappiness setting I asked about in the previous post?


Reply With Quote