LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   OOM Killer in embedded system (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/oom-killer-in-embedded-system-4175426138/)

nethomas1968 09-07-2012 11:20 AM

OOM Killer in embedded system
 
Apologies if this is not the right forum for this question.

I have an embedded Linux system. There is no Hard disk drive - so there is no swap space.

I know the 128MB isn't really enough for the task, but most stuff works - most of the time.

But, I do get an OOM_Killer killed task every so often, which is somewhat useless in an embedded system!, the unit needs a reboot to recover.

But, I notice that the proc/meminfo shows that there is still 20MB of 'Inactive' memory when the OOM_Killer kicks in.
Why can't the system use some of that 20MB?

I suspect that I am about 12MB short of a stable system.


Comments/suggestions welcome.

Regards

Nick

smallpond 09-08-2012 11:28 AM

Inactive memory should be available for use. Not sure what the threshold is for the Dreaded OOM, though. Maybe there is a tunable parameter some place.

One thing you could try is setting up a compressed ramdisk as swap space. Allocate 15M for it and it should give you an effective 30M of fairly fast swap.

engr04 10-16-2012 08:49 PM

My understanding is the kernel will cache as much as it can, essentially using up all of your memory. When you have a task that suddenly requires memory, the kernel needs to free up the cached memory. If it can't free the memory fast enough, you will get an OOM error.

You can set a minimum free memory that the kernel will not use as cache. This value can be modified through the following sysfs file: /proc/sys/vm/min_free_kbytes.

I think increasing this number will help.

Read current value:
Quote:

cat /proc/sys/vm/min_free_kbytes
Write a new value (4MB)
Quote:

echo 4096 > /proc/sys/vm/min_free_kbytes


All times are GMT -5. The time now is 08:27 PM.