• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Hot-add and Remove Logical Memory in CentOS/RHEL 7

by admin

This post explains how to use memory hotplug to increase/decrease the amount of memory.

To see (online/offline) state of memory section, read ‘state’ file.

# grep line /sys/devices/system/memory/*/state
/sys/devices/system/memory/memory0/state:online
/sys/devices/system/memory/memory1/state:online
/sys/devices/system/memory/memory2/state:online
/sys/devices/system/memory/memory3/state:online
/sys/devices/system/memory/memory4/state:online

To set a memory[x] to online/offline:

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

To verify the current state:

# free -m

More details could be found at : /usr/share/doc/kernel-doc-*/Documentation/memory-hotplug.txt

Filed Under: CentOS/RHEL, CentOS/RHEL 7

Some more articles you might also be interested in …

  1. How to Extend the Last Existing Filesystem Partition with Parted
  2. How to Disable the ‘lvm2-lvmetad.socket/service’ on CentOS/RHEL 7
  3. Understanding /etc/security/limits.conf file
  4. RHEL 7 – RHCSA Notes – Set enforcing and permissive modes for SELinux
  5. CentOS / RHEL 7 : How to configure kdump using GUI
  6. How to create LXC container using lxcbr0 and virbr0 in CentOS/RHEL
  7. How to Use iptables instead of firewalld on CentOS/RHEL 7 and 8
  8. “map in use” error while removing multipath device in CentOS/RHEL
  9. How to enable additional scsi logging in CentOS/RHEL
  10. “Couldn’t authenticate with keytab while discovering which salt to use: hostname: KDC has no support for encryption type” – error while joining domain

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright