Kernel SamePage Merging
Encyclopedia
Kernel SamePage Merging (also: Kernel Shared Memory, Memory Merging) lets system share identical memory pages amongst different processes or virtualized guests. This is done by scanning through the memory finding duplicate pages. The duplicate pair is then merged into a single page, and mapped into both original locations. The page is also marked as "copy-on-write", so the kernel will automatically separate them again should one process modify its data.
KSM was originally intended to run more virtual machine
s on one host by sharing memory
between processes
as well as virtual machines. Upon implementation
, it was also found to be useful for non-virtualized environments where memory is at a premium .
An experimental implementation of KSM by Red Hat found that 52 virtual instances of Windows XP with 1GB of memory, could run on a host computer that had only 16GB of RAM .
KSM first appeared in the version 2.6.32 Linux
operating system kernel
. To be effective, the operating system kernel must find similar memory pages held by different processes. As well it needs to decide whether the pages are going to update infrequently enough that SamePage Merging would be an efficient use of processor resources .
When first proposed, there were concerns that this feature could be exploit as a security vulnerability (this concern has since been addressed). Another concern is that although memory usage is reduced, CPU usage is increased, thus negating potential increases in performance .
KSM was originally intended to run more virtual machine
Virtual machine
A virtual machine is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software emulation or hardware virtualization or both together.-VM Definitions:A virtual machine is a software...
s on one host by sharing memory
Shared memory
In computing, shared memory is memory that may be simultaneously accessed by multiple programs with an intent to provide communication among them or avoid redundant copies. Depending on context, programs may run on a single processor or on multiple separate processors...
between processes
Process (computing)
In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system , a process may be made up of multiple threads of execution that execute instructions concurrently.A computer program is a...
as well as virtual machines. Upon implementation
Implementation
Implementation is the realization of an application, or execution of a plan, idea, model, design, specification, standard, algorithm, or policy.-Computer Science:...
, it was also found to be useful for non-virtualized environments where memory is at a premium .
An experimental implementation of KSM by Red Hat found that 52 virtual instances of Windows XP with 1GB of memory, could run on a host computer that had only 16GB of RAM .
KSM first appeared in the version 2.6.32 Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...
operating system kernel
Kernel (computing)
In computing, the kernel is the main component of most computer operating systems; it is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources...
. To be effective, the operating system kernel must find similar memory pages held by different processes. As well it needs to decide whether the pages are going to update infrequently enough that SamePage Merging would be an efficient use of processor resources .
When first proposed, there were concerns that this feature could be exploit as a security vulnerability (this concern has since been addressed). Another concern is that although memory usage is reduced, CPU usage is increased, thus negating potential increases in performance .