KSM (Kernel Samepage Merging)

From Thomas-Krenn-Wiki
Jump to: navigation, search

Kernel Samepage Merging (KSM) allows de-depulication of memory in Linux and has been released with kernel version 2.6.32. KSM tries to find identical Memory Pages and merge those to free memory. It tries to find memory pages that are updated seldom, otherwise it could be inefficient.

Originally KSM was developed for virtual machines. If these virtual machines use the same programs or operating systems, the overall memory usage can be reduced dramatically and more virtual machines can be operated with the available physical RAM.

Some tests from Red Hat have shown, that 52 virtual machines with Windows XP and 1 GB RAM can be operated on one server with only 16 GB RAM.

The virtualization KVM is supporting KSM. Based on this Bug-Report OpenVZ is not supporting it.

The following command allows to check if KSM is integrated into the kernel:

$ grep KSM /boot/config-`uname -r`

Further information and configuration options can be found in sysfs file system:

$ ls -1  /sys/kernel/mm/ksm/

Further Information

Related articles

Collect and report Linux System Activity Information with sar
Linux I/O Performance Tests using dd
Wake On LAN under Linux