Linux Memory Freeze – System Hanging When Out of Memory

freezelinuxmemory

I've got an eeePC 900a: it has a 8GB flash as disk and only 1GB of RAM. The Linux distribution installed on it is ArchLinux.

When the system runs out of memory it becomes extremely unresponsive: it takes several seconds/minutes to do things like switching to TTY1 or even moving the mouse pointer. Sometimes it looks like the system just freezes: three ours ago I let it alone and nothing at all is changed so far.

I'd rather avoid creating a swap partition/file on this eeePC since the disk is already that small, and also because the many writes on the swap space would shorten a lot the flash card life.
Moreover I think that a swap file/partition would just move the problem, rather than definitely fixing it.

Isn't the kernel supposed to kill some random applications when it runs out of memory? Why does it fail (or takes ages) at doing that?

A few months/years ago I already tried to look further into this, but couldn't find anything that would actually work…

Best Answer

It is possible to call OOM-killer (out of memory killer) directly by keyboard combination:

SysRq-F

SysRq key is usually combined within PrtSc key on keyboards.

OOM-killer kills some process(-es) and system becomes responsive again.

Thx Raman for advice on this feature in comments above.

PS: This helped me a lot. I agree with opinion that this is the most useful advise about that problem if it caused by Chrome or whatever memory greedy software. But you need to keep in mind that OOM-killer could kill some really important process, use it carefully.

Related Question