KSM (Kernel Samepage Merging) feature

From Thomas-Krenn-Wiki
Jump to navigation Jump to search
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

Related articles

Backup on Linux with duply
Console based Huawei Mini PCIe modem 4G connection with LES v3 under Debian
Updates with LXC 1.0