Recently we came across very strange issue wherein Linux virtual machine with Centos 5.X 32 Bit Operating System could not recognize more than 3 GB of RAM. After some research we could find following facts.
By default Centos 5.5 32 bit Operating System comes with Linux 2.4.x Kernel which does support more than 4GB of physical memory. A typical 32 bit Linux kernel uses 1GB of physical memory for it's own use as Kernel Space and rest of 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, if you add physical memory more than 3 GB in your machine, your machine would not address it. This issue can be fixed by adding PAE support in Kernel.
What is Physical Address Extension (PAE)?
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 PAE supported Kernel, set new Kernel to default as follows.
Again edit grub.conf file (it would look like the following), under title parameter you would see 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 fire free -m command to check whether it addresses the physical memory more than 3 GB or not.