KSM (Kernel Samepage Merging) feature
Please note that this article / this category refers either on older software / hardware components or is no longer maintained for other reasons. This page is no longer updated and is purely for reference purposes still here in the archive available. |
---|
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` CONFIG_KSM=y
Further information and configuration options can be found in sysfs file system:
$ ls -1 /sys/kernel/mm/ksm/ full_scans pages_shared pages_sharing pages_to_scan pages_unshared pages_volatile run sleep_millisecs
Further Information
- Kernel SamePage Merging (KSM) (en.wikipedia.org)
- Kernel Samepage Merging (KVM Wiki, www.linux-kvm.org)
- Using KSM (Kernel Samepage Merging) with KVM (www.linux-kvm.com)
- Chapter 21. KSM (Red Hat Enterprise Linux 6 Virtualization Guide, docs.redhat.com)