Recently we encountered a strange issue wherein a Linux virtual machine with CentOS 5.X 32 Bit Operating System could not recognize more than 3 GB of RAM.
After some research, we were able to find the following facts –
By default, the CentOS 5.5 32-bit Operating System comes with Linux 2.4.x Kernel, which supports more than 4GB of physical memory. A typical 32-bit Linux kernel uses 1GB of physical memory for its use as Kernel Space, and the rest of the physical memory will be used as User Space.
Hence, while you are on CentOS 5.X 32-bit Operating System machine without PAE support, user space, and kernel space split would be like 3GB/1GB. That means that if you add physical memory of more than 3 GB to your machine, your machine will not address it. This issue can be fixed by adding PAE support in kernel.
What is Physical Address Extension (PAE)?
Physical Address Extension (PAE), also known as Page Address Extension, is a memory management feature for the IE-32 (i386) architecture introduced with Pentium Pro processors.
Page Address Extension defines a three-level page table hierarchy with 64-bit table entries instead of 32. This allows CPUs with PAE to access a physical address space larger than 4 GB.
The PAE extension allows a maximum of 64 GB of physical memory that the CPU (not a process) can address. While PAE is not compiled into the kernel, the OS can address a maximum of 4 GB of RAM. If you are in a similar situation and wish to get kernel with PAE support, run the following command from the terminal –
yum install kernel-PAE
- Once Kernel is installed, edit grub.conf file (usually located at /etc/grub.conf or /boot/grub/grub.conf) with an editor of your choice.
- Locate the parameter timeout and set it to 10 or more seconds, so you can get more time to select the kernel from the list.
- Save grub.conf file and reboot your VPS.
- When your VM comes up after reboot, you will get a list of kernels currently installed in your machine.
- Select the kernel you wish to load (Kernel with PAE support).
If your VM boots successfully with a PAE-supported kernel, set the new kernel to default as follows. - Again, edit grub.conf file (it would look like the following), under the title parameter, you would see a list of all installed kernels.
Count the position of the kernel of your choice and set its value in parameter default. - Save the grub.conf file and reboot your VM.
default=3 // default holds the value of position of Kernel
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Enterprise Linux ES (2.4.21-37.EL) // Kernel in 1st position
root (hd0,0)
kernel /vmlinuz-2.4.21-37.EL ro root=/dev/hda3
initrd /initrd-2.4.21-37.EL.img
title Red Hat Enterprise Linux ES (2.4.21-32.0.1.EL) // Kernel in 2nd position
root (hd0,0)
kernel /vmlinuz-2.4.21-32.0.1.EL ro root=/dev/hda3
initrd /initrd-2.4.21-32.0.1.EL.img
title Red Hat Enterprise Linux ES (2.4.21-27.0.4.EL) // Kernel in 3rd position
root (hd0,0)
kernel /vmlinuz-2.4.21-27.0.4.EL ro root=/dev/hda3
initrd /initrd-2.4.21-27.0.4.EL.img
title Red Hat Enterprise Linux ES (2.4.21-27.0.2.EL) // Kernel in 4th position
root (hd0,0)
kernel /vmlinuz-2.4.21-27.0.2.EL ro root=/dev/hda3
initrd /initrd-2.4.21-27.0.2.EL.img
Once your VM comes up after reboot, run the free-m command to check whether it addresses the physical memory of more than 3 GB or not.