Wednesday, September 23, 2009

server kernel: __alloc_pages: 0-order allocation failed

SkyHi @ Wednesday, September 23, 2009
Jun 19 23:00:08 server kernel: __alloc_pages: 0-order allocation failed (gfp=0x1d2/0)
>Jun 19 23:00:11 server kernel: __alloc_pages: 2-order allocation failed (gfp=0x1f0/0)
>Jun 19 23:00:11 server kernel: __alloc_pages: 0-order allocation failed (gfp=0x1d2/0)
>Jun 19 23:00:11 server kernel: __alloc_pages: 0-order allocation failed (gfp=0x1f0/0)
>Jun 19 23:00:12 server kernel: __alloc_pages: 0-order allocation failed (gfp=0x1d2/0)
>Jun 19 23:00:12 server kernel: __alloc_pages: 2-order allocation failed (gfp=0x1f0/0)
>Jun 19 23:00:13 server syslogd: /var/log/messages: Cannot allocate memory
>Jun 19 23:00:13 server kernel: __alloc_pages: 0-order allocation failed (gfp=0x1f0/0)
>Jun 19 23:00:13 server kernel: __alloc_pages: 0-order allocation failed (gfp=0x1d2/0)
>Jun 19 23:00:13 server kernel: __alloc_pages: 0-order allocation failed (gfp=0x1d2/0)
>Jun 19 23:00:13 server kernel: VM: killing process fetchnews
>Jun 19 23:00:15 server kernel: __alloc_pages: 0-order allocation failed (gfp=0x1f0/0)


VM = Virtual Memory. the kernel ran out of REAL and Virtual memory, and
processes were still demanding more.

To survive this, the kernel goes into lifesaver mode and begins "reaping"
processes somewhat randomly in order to free memory so that it won't crash.
(I think the only process safe from reaping is probably init).

How to fix it?
1> Don't run more on your system than memory will allow.
2> find the software with the memory leak, kill it, and upgrade to a version
without that leak...
3> Buy more memory or add another swap partition.

Reference: http://aplawrence.com/Bofcusm/518.html