Monday, March 25, 2013

CentOS / RHEL / Oracle Linux memory hot-add


If hot-adding memory to CentOS / RHEL / Oracle Linux systems do this as root:


1- Check if the added memory showed up:

grep line /sys/devices/system/memory/*/state


2- If the new memory is offline, change state to online:
 
echo online > /sys/devices/system/memory/memory[number]/state

If you are not allowed to change the memory state to online and if running OS version 6.2 or later then try this first and then retry onlining  it again:


echo 3 > /proc/sys/vm/drop_caches && echo 1 > /proc/sys/vm/compact_memory
and then

echo online > /sys/devices/system/memory/memory[number]/state



____________________________________________________________________________________________
[DISCLAIMER] Do this at your own risk. Don't blame me if anything bad happens!