In Red Hat Enterprise Linux 5, dom0 crashes on boot with an "out of memory" error. How do I prevent this?

Updated -

Release Found: Red Hat Enterprise Linux 5

In Red Hat Enterprise Linux 5.2 and earlier, dom0 may be automatically configured such that the Xen hypervisor does not have enough memory to function correctly. This is particularly common on systems with large amounts of memory (128GB and up). If you encounter this situation you will see the following while the system is booting:

Kernel command line: ro root=LABEL=/1 earlyprintk=ttyS0,115200
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 32768 bytes)
Xen reported: 2493.374 MHz processor.
disabling early console
Console: colour VGA+ 80x25
Dentry cache hash table entries: 33554432 (order: 16, 268435456 bytes)
Inode-cache hash table entries: 16777216 (order: 15, 134217728 bytes)
low bootmem alloc of 67108864 bytes failed!
Kernel panic - not syncing: Out of low memory
 (XEN) Domain 0 crashed: rebooting machine in 5 seconds.

Beginning with Red Hat Enterprise Linux 5.3, dom0 will be automatically configured with 32GB of memory even if the system has more. In general, Red Hat recommends configuring dom0 with only enough memory for any needed management and monitoring utilities and to reserve the rest for guests. You can manually configure dom0's memory allocation by setting dom0_mem on the kernel line in /etc/grub.conf, for example:

title Red Hat Enterprise Linux Server (2.6.18-128.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-128.el5 dom0_mem=2G
        module /vmlinuz-2.6.18-128.el5xen ro root=/dev/VolGroup00/LogVol00 crashkernel=64M@16M
        module /initrd-2.6.18-128.el5xen.img

On the Itanium2 platform, dom0 will be configured with 4GB of memory by default. dom0_mem can be set on the append line in /etc/elilo.conf. Be sure to put it before the double dashes (--):

        append="dom0_mem=16G -- root=LABEL=/1"

On either platform you can check the total amount of memory available to the system with the command virsh nodeinfo:

# virsh nodeinfo
CPU model:           ia64
CPU(s):              16
CPU frequency:       1599 MHz
CPU socket(s):       4
Core(s) per socket:  2
Thread(s) per core:  2
NUMA cell(s):        1
Memory size:         134170624 kB