SymptomsWhen you hot add memory to a Linux virtual machine, it may not be displayed in the output of the free or top commands.
ResolutionIn the above situation, you need to make sure the needed modules are loaded and then put the memory in the "online" state manually in order for it to be detected by the guest OS. Follow the below steps to do this:
Note: The first two steps are usually needed for SLES guests only.
1. Check if the acpiphp and acpi_memhotplug modules are loaded properly with
# lsmod | grep acpi
acpiphp 43673 0
acpi_memhotplug 42199 0
If they are not loaded, load them with
# modprobe acpiphp
# modprobe acpi_memhotplug
2. Try increasing the virtual machine memory again via command line tools or GUI, e.g., PMC or PVA.
3. Create a memory_online.sh shell script with the below content:
for a in `ls /sys/devices/system/memory/memory*/state`;
echo "online" > $a;
grep offline /sys/devices/system/memory/memory*/state
Save it and exit.
4. Allow execution of this script with
# chmod u+x memory_online.sh
5. Execute the script:
It should return no output.
Note: On Ubuntu, you may need to run it like this:
# /bin/bash memory_online.sh
6. Check the new memory configuration, either in the /proc/meminfo file or by running the below command