28

Lately, I've noticed entries like this one in the kern.log of one of my servers:

Feb 16 00:24:05 aramis kernel: swapper: page allocation failure. order:0, mode:0x20

I'd like to know:

  1. What exactly does that message mean?
  2. Is my server running out of memory?

The swap usage is quite low (less than 10%), and so far I haven't noticed any processes being killed because of lack of memory.

Additional information:

  • The server is a Xen instance (DomU) running Debian 6.0
  • It has 512 MB of RAM and a 512 MB swap partition
  • CPU load inside the virtual machine shows an average of 0.25
Nathan
  • 157
  • 7
mfriedman
  • 1,959
  • 1
  • 13
  • 14

3 Answers3

16

Debian bug 666021 seems to be a report of this same issue. The suggestion there is:

#change value for this boot
sysctl -w vm.min_free_kbytes=65536

#change value for subsequent boots
echo "vm.min_free_kbytes=65536" >> /etc/sysctl.conf

http://russ.garrett.co.uk/2009/01/01/linux-kernel-tuning/ has some discussion of when altering this setting may be useful, reproduced here:

This tells the kernel to try and keep 64MB of RAM free at all times. It’s useful in two main cases:

  • Swap-less machines, where you don’t want incoming network traffic to overwhelm the kernel and force an OOM before it has time to flush any buffers.

  • x86 machines, for the same reason: the x86 architecture only allows DMA transfers below approximately 900MB of RAM. So you can end up with the bizarre situation of an OOM error with tons of RAM free.

I applied this setting on my 3.2.12-gentoo x86 machine, but I'm still getting these errors.

Matt McHenry
  • 785
  • 7
  • 9
  • This very same thing can occur with certain devices, for example with MPT Fusion SCSI controller it's recommended to keep vm.min_free_kbytes around 100 megabytes. Or at least it was used to, when I last had to use those things with 32-bit Linux distros. Things might have been changed since then. – Janne Pikkarainen Jun 25 '12 at 17:17
  • 2
    **IMPORTANT WARNING**. `echo 104857600 > /proc/sys/vm/min_free_kbytes` **CAUSED MY SYSTEM TO KERNEL PANIC, reproducibly**. Quite a bit of text flew up the screen in the process that I had no hope of reading, but the last messages concerned my Wi-Fi dongle, so this brokenness may be specific to my system. That being said, poke with caution. – i336_ Jun 16 '19 at 14:28
  • 4
    OH, it's in *kilobytes*. I can't concretely remember if I did 104857600 or 10485760, but if I did the former I tried to reserve 100GB, which this laptop does *not* have installed ;) I'll try fiddling with this in a VM sometime. – i336_ Jun 16 '19 at 14:30
2

It may also be worth checking vm.zone_reclaim_mode: see http://www.kernel.org/doc/Documentation/sysctl/vm.txt

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
mblakele
  • 131
  • 2
1

I've just worked through this error on a Lenovo NAS running Debian 5 and kernel 2.6.39.3 64bit.

The messages are informational despite looking scary, according to https://www.novell.com/support/kb/doc.php?id=7002803

However, they were filling my very limited root partition (this device has a 50 MByte root partition ?!)

The fix for me was to set vm.min_free_kbytes from 65536 down to 16384.

Afterwards, the OS still has 107 MBytes free memory and 2 GB in buffers. This makes no sense, but it stopped all the logging.

Nathan
  • 157
  • 7
Criggie
  • 2,219
  • 13
  • 25