Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. Kernel SamePage
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 machines 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.