A computer system has one or more software context that share use of a memory that is divided into units such as pages. In the preferred embodiment of the invention, the context are, or include, virtual machines running on a common hardware platform. The context, as opposed to merely the addresses or page numbers, of virtual memory pages that accessible to one or more contexts are examined. If two or more context pages are identical, then their memory mappings are changed to point to a single, shared copy of the page in the hardware memory, thereby freeing the memory space taken up by the redundant copies. The shared copy is ten preferable marked copy-on-write. Sharing is preferably dynamic, whereby the presence of redundant copies of pages is preferably determined by hashing page contents and performing full content comparisons only when two or more pages hash to the same key. |
Citations|
| US5757919 | Dec 12, 1996 | May 26, 1998 | Intel Corporation | Cryptographically protected paging subsystem | | US6075938 | Jun 10, 1998 | Jun 13, 2000 | The Board of Trustees of the Leland Stanford Junior University | Virtual machine monitors for scalable multiprocessors | | US6138113 | Aug 10, 1998 | Oct 24, 2000 | AltaVista Company | Method for identifying near duplicate pages in a hyperlinked database | | US6233668 | Oct 27, 1999 | May 15, 2001 | Compaq Computer Corporation | Concurrent page tables | | US6349355 | Feb 6, 1997 | Feb 19, 2002 | Microsoft Corporation | Sharing executable modules between user and kernel threads | | US6374266 | Jul 24, 1999 | Apr 16, 2002 | | Method and apparatus for storing information in a data processing system | | US6496847 | Sep 10, 1998 | Dec 17, 2002 | VMWare, Inc. | System and method for virtualizing computer systems | | US6560688 | Oct 1, 1998 | May 6, 2003 | Advanced Micro Devices, Inc. | System and method for improving accelerated graphics port systems | | US6567907 | Oct 19, 2000 | May 20, 2003 | Hewlett-Packard Development Company L.P. | Avoiding mapping conflicts in a translation look-aside buffer | | US6581142 | Sep 1, 2000 | Jun 17, 2003 | International Business Machines Corporation | Computer program product and method for partial paging and eviction of microprocessor instructions in an embedded computer | | US20020099946 | Apr 30, 1998 | | | CRYPTOGRAPHICALLY PROTECTED PAGING SUBSYSTEM | | US20020174315 | May 16, 2001 | | | Load distribution of multiple disks |
Referenced by|
| US6880022 | Apr 19, 2004 | Apr 12, 2005 | VMware, Inc. | Transparent memory address remapping | | US6895491 | Sep 26, 2002 | May 17, 2005 | Hewlett-Packard Development Company, L.P. | Memory addressing for a virtual machine implementation on a computer processor supporting virtual hash-page-table searching | | US6907600 | Dec 27, 2000 | Jun 14, 2005 | Intel Corporation | Virtual translation lookaside buffer | | US6986006 | Apr 17, 2002 | Jan 10, 2006 | Microsoft Corporation | Page granular curtained memory via mapping control | | US7035963 | Dec 27, 2000 | Apr 25, 2006 | Intel Corporation | Method for resolving address space conflicts between a virtual machine monitor and a guest operating system | | US7043494 | Jan 28, 2003 | May 9, 2006 | PMC-Sierra, Inc. | Fast, deterministic exact match look-ups in large tables | | US7203944 | Jul 9, 2003 | Apr 10, 2007 | VERITAS Operating Corporation | Migrating virtual machines among computer systems to balance load caused by virtual machines | | US7213246 | Mar 28, 2002 | May 1, 2007 | Veritas Operating Corporation | Failing over a virtual machine | | US7246200 | Nov 12, 2003 | Jul 17, 2007 | VERITAS Operating Corporation | Provisioning and snapshotting using copy on read/write and transient virtual machine technology | | US7254673 | Dec 30, 2004 | Aug 7, 2007 | EMC Corporation | Provision of a victim cache within a storage cache hierarchy | | US7266637 | Apr 9, 2004 | Sep 4, 2007 | VERITAS Operating Corporation | Storage management system | | US7272831 | Mar 30, 2001 | Sep 18, 2007 | Intel Corporation | Method and apparatus for constructing host processor soft devices independent of the host processor operating system | | US7302514 | Jun 15, 2004 | Nov 27, 2007 | Intel Corporation | Device, system, and method of virtual machine memory mapping | | US7313669 | Feb 28, 2005 | Dec 25, 2007 | Intel Corporation | Virtual translation lookaside buffer | | US7334076 | Mar 8, 2005 | Feb 19, 2008 | Microsoft Corporation | Method and system for a guest physical address virtualization in a virtual machine environment | | US7373451 | Dec 8, 2004 | May 13, 2008 | The Board of Trustees of the Leland Stanford Junior University | Cache-based system management architecture with virtual appliances, network repositories, and virtual appliance transceivers | | US7441092 | Apr 20, 2006 | Oct 21, 2008 | Microsoft Corporation | Multi-client cluster-based backup and restore | | US7441097 | Sep 10, 2003 | Oct 21, 2008 | Seagate Technology LLC | Data storage system and method for adaptive reconstruction of a directory structure | | US7444499 | Mar 28, 2006 | Oct 28, 2008 | Sun Microsystems, Inc. | Method and system for trace generation using memory index hashing | | US7447857 | Feb 28, 2008 | Nov 4, 2008 | Microsoft Corporation | Multi-client cluster-based backup and restore | | US7448079 | Jul 3, 2001 | Nov 4, 2008 | Ernst & Young, LLP | Method and apparatus for providing computer services | | US7454477 | May 16, 2005 | Nov 18, 2008 | Microsoft Corporation | Zero-copy transfer of memory between address spaces | | US7487307 | Jan 5, 2006 | Feb 3, 2009 | International Business Machines Corporation | Method, apparatus and program product for managing memory in a virtual computing system | | US7500048 | Sep 22, 2006 | Mar 3, 2009 | VMware, Inc. | Transparent page sharing on commodity operating systems | | US7533229 | Jun 12, 2006 | May 12, 2009 | Symantec Operating Corporation | Disaster recovery and backup using virtual machines | | US7555620 | Apr 28, 2006 | Jun 30, 2009 | Network Appliance, Inc. | Method and system of using a backup image for multiple purposes | | US7571274 | Dec 30, 2004 | Aug 4, 2009 | Intel Corporation | Method and system for virtual enclosure management | | US7596654 | Jan 26, 2006 | Sep 29, 2009 | Symantec Operating Corporation | Virtual machine spanning multiple computers | | US7603670 | Mar 28, 2002 | Oct 13, 2009 | Symantec Operating Corporation | Virtual machine transfer between computer systems | | US7607011 | Jul 16, 2004 | Oct 20, 2009 | Rockwell Collins, Inc. | System and method for multi-level security on a network | | US7636824 | Jun 4, 2007 | Dec 22, 2009 | Acronis Inc. | System and method for efficient backup using hashes | | US7636831 | Mar 31, 2006 | Dec 22, 2009 | VMware, Inc. | Optimization of reverse mappings for immutable guest physical pages of virtual memories in a virtualized computer system | | US7644246 | Dec 9, 2005 | Jan 5, 2010 | Microsoft Corporation | Using limits on address translation to control access to an addressable entity | | US7647589 | May 31, 2005 | Jan 12, 2010 | Parallels Software International, Inc. | Methods and systems for safe execution of guest code in virtual machine context | | US7650478 | Dec 9, 2005 | Jan 19, 2010 | Microsoft Corporation | Using limits on address translation to control access to an addressable entity | | US7653794 | May 8, 2006 | Jan 26, 2010 | Microsoft Corporation | Converting physical machines to virtual machines | | US7702843 | Sep 21, 2006 | Apr 20, 2010 | VMware, Inc. | Determining memory conditions in a virtual machine | | US7716446 | Sep 21, 2006 | May 11, 2010 | VMware, Inc. | System and method for cooperative virtual machine memory scheduling | | US7716667 | Feb 13, 2007 | May 11, 2010 | Symantec Operating Corporation | Migrating virtual machines among computer systems to balance load caused by virtual machines | | US7769826 | Jun 26, 2003 | Aug 3, 2010 | Nominum, Inc. | Systems and methods of providing DNS services using separate answer and referral caches | | US7793287 | Oct 1, 2003 | Sep 7, 2010 | Hewlett-Packard Development Company, L.P. | Runtime virtualization and devirtualization of I/O devices by a virtual machine monitor | | US7797507 | Jul 25, 2007 | Sep 14, 2010 | NEC Corporation | Virtual machine system and operating method thereof | | US7805723 | Oct 1, 2003 | Sep 28, 2010 | Hewlett-Packard Development Company, L.P. | Runtime virtualization and devirtualization of memory by a virtual machine monitor | | US7809875 | Jun 30, 2008 | Oct 5, 2010 | Wind River Systems, Inc. | Method and system for secure communication between processor partitions | | US7809888 | Jun 22, 2005 | Oct 5, 2010 | EMC Corporation | Content-aware caching techniques | | US7810092 | Mar 2, 2004 | Oct 5, 2010 | Symantec Operating Corporation | Central administration and maintenance of workstations using virtual machines, network filesystems, and replication | | US7814328 | Sep 12, 2005 | Oct 12, 2010 | Microsoft Corporation | Digital signatures for embedded code | | US7814491 | Apr 14, 2004 | Oct 12, 2010 | Oracle America, Inc. | Method and apparatus for managing system resources using a container model | | US7865893 | Feb 7, 2006 | Jan 4, 2011 | Parallels Holdings, Ltd. | System and method for starting virtual machine monitor in common with already installed operating system | | US7877570 | Aug 14, 2007 | Jan 25, 2011 | Red Hat, Inc. | Consolidation of matching memory pages | | US7877734 | Jan 12, 2006 | Jan 25, 2011 | International Business Machines Corporation | Selective profiling of program code executing in a runtime environment | | US7890689 | Mar 6, 2008 | Feb 15, 2011 | The Board of Trustees of the Leland Stanford Junior University | Virtual appliance management | | US7890712 | Dec 31, 2008 | Feb 15, 2011 | International Business Machines Corporation | Method, apparatus and program product for managing memory in a virtual computing system | | US7900002 | Mar 3, 2008 | Mar 1, 2011 | Microsoft Corporation | Multi-client cluster-based backup and restore | | US7913226 | Oct 1, 2003 | Mar 22, 2011 | Hewlett-Packard Development Company, L.P. | Interposing a virtual machine monitor and devirtualizing computer hardware at runtime | | US7925850 | Feb 16, 2007 | Apr 12, 2011 | VMware, Inc. | Page signature disambiguation for increasing the efficiency of virtual machine migration in shared-page virtualized computer systems | | US7958374 | Jun 18, 2007 | Jun 7, 2011 | Shansun Technology Company | Digital information protecting method and apparatus, and computer accessible recording medium | | US7984264 | Nov 6, 2009 | Jul 19, 2011 | VMware, Inc. | Maintaining reverse mappings in a virtualized computer system | | US7987432 | Apr 24, 2007 | Jul 26, 2011 | Parallels Holdings, Ltd. | Seamless integration and installation of non-native application into native operating system | | US7995584 | Jun 19, 2008 | Aug 9, 2011 | Hewlett-Packard Development Company, L.P. | Method and apparatus for detecting malicious routers from packet payload | | US7996548 | Dec 30, 2008 | Aug 9, 2011 | Intel Corporation | Message communication techniques | | US8015367 | Feb 16, 2007 | Sep 6, 2011 | VMware, Inc. | Memory management methods in a computer system with shared memory mappings | | US8024742 | Sep 30, 2004 | Sep 20, 2011 | Jaluna S.A. | Common program for switching between operation systems is executed in context of the high priority operating system when invoked by the high priority OS | | US8037279 | Jun 12, 2008 | Oct 11, 2011 | Oracle America, Inc. | Method and system for cross-domain data sharing | | US8051111 | Jan 31, 2008 | Nov 1, 2011 | Prowess Consulting, LLC | Method and system for modularizing windows imaging format | | US8056076 | Jun 29, 2006 | Nov 8, 2011 | VMware, Inc. | Method and system for acquiring a quiesceing set of information associated with a virtual machine | | US8060747 | Mar 20, 2006 | Nov 15, 2011 | Microsoft Corporation | Digital signatures for embedded code | | US8074047 | May 16, 2008 | Dec 6, 2011 | International Business Machines Corporation | System and method for content replication detection and elimination in main memory | | US8095931 | Sep 21, 2006 | Jan 10, 2012 | VMware, Inc. | Controlling memory conditions in a virtual machine | | US8108560 | Nov 22, 2005 | Jan 31, 2012 | Hewlett-Packard Development Company, L.P. | Method and apparatus for managing data transfer in a computer memory | | US8112585 | Apr 30, 2009 | Feb 7, 2012 | NetApp, Inc. | Method and apparatus for dynamically switching cache policies | | US8117554 | Mar 15, 2009 | Feb 14, 2012 | Parallels Holdings, Ltd. | Seamless integration of non-native widgets and windows with dynamically scalable resolution into native operating system | | US8135899 | Apr 11, 2011 | Mar 13, 2012 | Parallels IP Holdings GmbH | Expansion of virtualized physical memory of virtual machine | | US8151026 | Aug 31, 2010 | Apr 3, 2012 | Wind River Systems, Inc. | Method and system for secure communication between processor partitions | | US8151263 | Mar 19, 2007 | Apr 3, 2012 | VMware, Inc. | Real time cloning of a virtual machine | | US8166253 | Aug 12, 2011 | Apr 24, 2012 | VMware, Inc. | Memory management system in a computer system with shared memory mappings | | US8176279 | Mar 20, 2008 | May 8, 2012 | International Business Machines Corporation | Managing use of storage by multiple pageable guests of a computing environment | | US8176280 | Mar 20, 2008 | May 8, 2012 | International Business Machines Corporation | Use of test protection instruction in computing environments that support pageable guests | | US8176488 | Dec 25, 2009 | May 8, 2012 | Parallels IP Holdings GmbH | Methods and systems for determining potentially unsafe instructions in a virtual machine context and activating a software debugger to process the potentially unsafe instructions | | US8190827 | Feb 27, 2009 | May 29, 2012 | Red Hat, Inc. | Memory sharing among computer programs | | US8190902 | Feb 27, 2006 | May 29, 2012 | Microsoft Corporation | Techniques for digital signature formation and verification | | US8201170 | Apr 7, 2004 | Jun 12, 2012 | Jaluna SA | Operating systems are executed on common program and interrupt service routine of low priority OS is modified to response to interrupts from common program only | | US8205087 | Feb 27, 2006 | Jun 19, 2012 | Microsoft Corporation | Tool for digitally signing multiple documents | | US8230203 | Mar 30, 2007 | Jul 24, 2012 | Intel Corporation | Detecting spin loops in a virtual machine environment | | US8234655 | Jul 29, 2008 | Jul 31, 2012 | International Business Machines Corporation | Detection of duplicate memory pages across guest operating systems on a shared host |
Claims1. In a computer system that includes a hardware memory and at least one context, which has a virtual memory that is divided into a plurality of virtual memory units that are mappable to corresponding hardware memory units, a method comprising the following steps: - selecting candidate memory units from among the virtual memory units;
- identifying virtual memory units that have contents identical to those of the candidate memory units; and
- mapping those virtual memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units
- in which:
- the step of identifying virtual memory units that have identical contents includes the following sub-steps:
- calculating a hash value by applying a hash function to the contents of a current one of the candidate memory units;
- searching a data structure to determine the presence of a previous data structure entry corresponding to the calculated hash value;
- if a previous entry is not present in the data structure, inserting into the data structure a new entry corresponding to the current candidate memory unit; and
- if a previous entry is present in the data structure, comparing the entire contents of the current candidate memory unit with the contents of the single instance indicated by the previous entry.
2. A method as in claim 1, in which the data structure is a hash table. 3. A method as in claim 1, - in which the step of mapping the virtual memory units having identical contents further comprises write-protecting selected ones of the virtual memory units that are mapped to the single instance.
4. A method as in claim 3, which any and all of the virtual memory units that are mapped to the single instance are write-protected. 5. A method as in claim 3, further including the following steps: - sensing a request by any context to write to any write-protected virtual memory unit and, upon sensing such request,
- for the requesting context, generating in the hardware memory a private copy of the write-protected virtual memory unit; and
- remapping the write-protected virtual memory unit to the private copy.
6. A method as in claim 3, further comprising the step of identifying virtual memory units that have a relatively high probability of impending modification. 7. A method as in claim 6, further comprising the following steps: - designating as temporarily non-sharable the virtual memory units that have the relatively high probability of impending modification; and
- deferring the step of mapping to the single instance for the temporarily non-sharable virtual memory units.
8. A method as in claim 6, further comprising the following steps: - designating as temporarily non-sharable the virtual memory units that have the relatively high probability of impending modification; and
- deferring the step of write-protecting each temporarily non-sharable virtual memory unit until a subsequent identification of a different one of the virtual memory units having contents identical to the respective temporarily non-sharable virtual memory unit.
9. A method as in claim 3, further comprising deferring the step of write-protecting each virtual memory unit for which no other virtual memory unit has yet been identified as having identical contents. 10. A method as in claim 1, in which the step of identifying virtual memory units that have identical contents comprises randomly selecting the virtual memory units for content comparison with at least one other of the virtual memory units. 11. A method as in claim 1, in which the step of identifying virtual memory units that have identical contents comprises selecting the virtual memory units for content comparison with at least one other of the virtual memory units according to a predetermined heuristic criterion. 12. A method as in claim 1, in which the step of identifying virtual memory units is performed during a system idle time. 13. A method as in claim 1, in which at least one context is a virtual machine. 14. A method as in claim 1, in which at least one context is a virtual disk. 15. A method as in claim 1, in which the step of identifying virtual memory units that have identical contents comprises the step of comparing the contents of each of the virtual memory units with the contents of each of the other virtual memory units. 16. A method as in claim 1, further comprising the following steps: - partitioning the virtual memory units into a plurality of classes; and
- performing the step of identifying virtual memory units that have identical contents and the step of mapping those virtual memory units to a single shared instance of a corresponding hardware memory unit separately and independently for each of the classes,
- sharing single instances of the hardware memory units thereby taking place only among virtual memory units in the same class.
17. A method as in claim 16, in which the classes are page colors of the hardware memory units to which the corresponding virtual memory units are currently mapped. 18. A method as in claim 16, in which the computer system further has a multiprocessor architecture with a non-uniform memory access property and a plurality of memory modules having different access latency, and in which the classes are the memory modules to which the corresponding virtual memory units are currently mapped. 19. A method for sharing memory in a computer system comprising: - installing in the computer system at least one virtual machine that comprises:
- at least one address space that is divided into a plurality of virtual memory units; and
- a virtual operating system that maps each virtual memory unit to a corresponding intermediate memory unit;
- selecting candidate memory units from among the intermediate memory units;
- for each virtual machine, maintaining in a virtual machine monitor an intermediate mapping that maps each intermediate memory unit to a corresponding hardware memory unit of a hardware memory;
- identifying intermediate memory units that have identical contents by hashing the contents of the candidate memory units; and
- via the intermediate mapping, mapping those intermediate memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units;
- in which the step of identifying intermediate memory units that have identical contents further includes the following sub-steps:
- calculating a hash value by applying a hash function to the contents of a current one of the candidate memory units;
- searching a data structure to determine the presence of a previous data structure entry corresponding to the calculated hash value;
- if a previous entry is not present in the data structure, inserting into the data structure a new entry corresponding to the current candidate memory unit; and
- if a previous entry is present in the data structure, comparing the entire contents of the current candidate memory unit with the contents of the single instance indicated by the previous entry.
20. A method as in claim 19, in which the data structure is a hash table. 21. A method as in claim 19, - in which the step of mapping the intermediate memory units having identical contents further comprises write-protecting selected ones of the intermediate memory units that are mapped to the single instance.
22. A method as in claim 21, in which any and all of the intermediate memory units that are mapped to the single instance are write-protected. 23. A method as in claim 21, further including the following steps: - sensing a request by any context to write to any write-protected intermediate memory unit and, upon sensing such request,
- for the requesting context, generating in the hardware memory a private copy of the write-protected intermediate memory unit; and
- remapping the write-protected intermediate memory unit to the private copy.
24. A method as in claim 21, further comprising the step of identifying intermediate memory units that have a relatively high probability of impending modification. 25. A method as in claim 24, further comprising the following steps: - designating as temporarily non-sharable the intermediate memory units that have the relatively high probability of impending modification; and
- deferring the step of mapping to the single instance for the temporarily non-sharable intermediate memory units.
26. A method as in claim 24, further comprising the following steps: - designating as temporarily non-sharable the intermediate memory units that have the relatively high probability of impending modification; and
- deferring the step of write-protecting each temporarily non-sharable intermediate memory unit until a subsequent identification of a different one of the intermediate memory units having contents identical to the respective temporarily non-sharable intermediate memory unit.
27. A method as in claim 21, further comprising deferring the step of write-protecting each intermediate memory unit for which no other intermediate memory unit has yet been identified as having identical contents. 28. A method as in claim 19, in which the step of identifying intermediate memory units that have identical contents comprises randomly selecting the intermediate memory units for content comparison with at least one other of the intermediate memory units. 29. A method as in claim 19, in which the step of identifying intermediate memory units that have identical contents comprises selecting the intermediate memory units for content comparison with at least one other of the intermediate memory units according to a predetermined heuristic criterion. 30. A method as in claim 19, in which the step of identifying intermediate memory units is performed during a system idle time. 31. A method as in claim 19, in which the step of identifying intermediate memory units that have identical contents comprises the step of comparing the contents of each of the intermediate memory units with the contents of each of the other intermediate memory units. 32. A method as in claim 19, further comprising the following steps: - partitioning the intermediate memory units into a plurality of classes; and
- performing the step of identifying intermediate memory units that have identical contents and the step of mapping those intermediate memory units to a single shared instance of a corresponding hardware memory unit separately and independently for each of the classes,
- sharing single instances of the hardware memory units thereby taking place only among intermediate memory units in the same class.
33. A method as in claim 32, in which the classes are page colors of the hardware memory units to which the corresponding intermediate memory units are currently mapped. 34. A method as in claim 32, in which the computer system further has a multiprocessor architecture with a non-uniform memory access property and a plurality of memory modules having different access latency, and in which the classes are the memory modules to which the corresponding intermediate memory units are currently mapped. 35. In a computer system that includes a hardware memory and at least one context, which has a virtual memory that is divided into a plurality of virtual memory units that are mappable to corresponding hardware memory units, a method comprising the following steps: - A) identifying virtual memory units that have identical contents; and
- B) mapping those virtual memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units;
- in which:
- C) the step of identifying virtual memory units that have identical contents includes the following sub-steps:
- i) selecting candidate memory units from among the virtual memory units;
- ii) calculating a hash value by applying a hash function to the contents of a current one of the candidate memory units;
- iii) searching a hash table to determine the presence of a previous hash table entry corresponding to the calculated hash value and
- a) if a previous entry is not present in the hash table, inserting into the hash table a new entry corresponding to the current candidate memory unit; and
- b) if a previous entry is present in the hash table, comparing the entire contents of the current candidate memory unit with the contents of the single instance indicated by the previous entry;
- D) write-protecting selected ones of the virtual memory units that are mapped to the single instance; and
- E) sensing a request by any context to write to any write-protected virtual memory unit and, upon sensing such request, for the requesting context, generating in the hardware memory a private copy of the write-protected virtual memory unit and remapping the write-protected virtual memory unit to the private copy.
36. A method for sharing memory in a computer system comprising: - A) installing in the computer system at least one virtual machine that comprises:
- i) at least one address space that is divided into a plurality of virtual memory units; and
- ii) a virtual operating system that maps each virtual memory unit to a corresponding intermediate memory unit;
- B) for each virtual machine, maintaining in a virtual machine monitor an intermediate mapping that maps each intermediate memory unit to a corresponding hardware memory unit of a hardware memory;
- C) identifying intermediate memory units that have identical contents; and
- D) via the intermediate mapping, mapping those intermediate memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units;
- in which:
- D) the step of identifying intermediate memory units that have identical contents includes the following sub-steps:
- i) selecting candidate memory units from among the intermediate memory units;
- ii) calculating a hash value by applying a hash function to the contents of a current one of the candidate memory units;
- iii) searching a hash table to determine the presence of a previous hash table entry corresponding to the calculated hash value and
- a) if a previous entry is not present in the hash table, inserting into the hash table a new entry corresponding to the current candidate memory unit; and
- b) if a previous entry is present in the hash table, comparing the entire contents of the current candidate memory unit with the contents of the single instance indicated by the previous entry;
- E) write-protecting selected ones of the intermediate memory units that are mapped to the single instance; and
- F) sensing a request by any context to write to any write-protected virtual memory unit and, upon sensing such request, for the requesting context, generating in the hardware memory a private copy of the write-protected virtual memory unit and remapping the write-protected virtual memory unit to the private copy.
37. A computer system comprising: - a hardware memory;
- at least one context, which has a virtual memory that is divided into a plurality of virtual memory units that are mappable to corresponding hardware memory units; and
- a memory sharing module comprising computer-executable code for identifying virtual memory units that have identical contents and for mapping those virtual memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units
- in which:
- the memory sharing module includes:
- a candidate selection sub-module for selecting candidate memory units from among the virtual memory units; and
- a hashing sub-module or hashing the contents of the candidate memory units;
- the hashing module is further provided for calculating a hash value by applying a hash function to the contents of a current one of the candidate memory units and for searching a data structure to determine the presence of a previous data structure entry corresponding to the calculated hash value; and
- the memory sharing module is further provided for inserting into the data structure a new entry corresponding to the current candidate memory unit if a previous entry is not present in the data structure; and for comparing the entire contents of the current candidate memory unit with the contents of the single instance indicated by the previous entry if a previous entry is present in the data structure.
38. A system as in claim 37, in which the data structure is a hash table. 39. A system as in claim 37, further comprising: - a write-protection mechanism for write-protecting selected ones of the virtual memory units that are mapped to the single instance.
40. A system as in claim 39, in which any and all of the virtual memory units that are mapped to the single instance are write-protected. 41. A system as in claim 39, in which the memory sharing module is further provided for sensing a request by any context to write to any write-protected virtual memory unit and, upon sensing such request, for the requesting context, for generating in the hardware memory a private copy of the write-protected virtual memory unit and for remapping the write-protected virtual memory unit to the private copy. 42. A system as in claim 39, in which the memory sharing module is provided for deferring the step of write-protecting each virtual memory unit for which no other virtual memory unit has yet been identified as having identical contents. 43. A system as in claim 37, in which at least one context is a virtual machine. 44. A system as in claim 37, in which at least one context is a virtual disk. 45. A system as in claim 37, in which the memory sharing module is provided for comparing the contents of each of the virtual memory units with the contents of each of the other virtual memory units. 46. A system as in claim 37, in which: - the virtual memory units are partitioned into a plurality of classes; and
- the memory sharing module is further provided for identifying virtual memory units that have identical contents and for mapping those virtual memory units to a single shared instance of a corresponding hardware memory unit separately and independently for each of the classes, whereby single instances of the hardware memory units are shared only among virtual memory units in the same class.
47. A system as in claim 46, in which the classes are page colors of the hardware memory units to which the corresponding virtual memory units are currently mapped. 48. A system as in claim 46, in which the computer system further has a multiprocessor architecture with a non-uniform memory access property and a plurality of memory modules having different access latency, and in which the classes are the memory modules to which the corresponding virtual memory units are currently mapped. 49. A computer system comprising: - a hardware memory;
- at least one virtual machine that comprises:
- at least one address space that is divided into a plurality of virtual memory units; and
- a virtual operating system including means for mapping each virtual memory unit to a corresponding intermediate memory unit;
- for each virtual machine, a corresponding virtual machine monitor including intermediate mapping means for mapping each intermediate memory unit to a corresponding hardware memory unit of the hardware memory;
- a memory sharing module comprising computer-executable code for identifying intermediate memory units that have identical contents, and, via the intermediate mapping means, for mapping those intermediate memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units;
- in which:
- the memory sharing module includes:
- a candidate selection sub-module for selecting candidate memory units from among the intermediate memory units; and
- a hashing sub-module for hashing the contents of the candidate memory units;
- the hashing module is further provided for calculating a hash value by applying a hash function to the contents of a current one of the candidate memory units and for searching a data structure to determine the presence of a previous data structure entry corresponding to the calculated hash value; and
- the memory sharing module is further provided for inserting into the data structure a new entry corresponding to the current candidate memory unit if a previous entry is not present in the data structure; and for comparing the entire contents of the current candidate memory unit with the contents of the single instance indicated by the previous entry if a previous entry is present in the data structure.
50. A system as in claim 49, in which the data structure is a hash table. 51. A system as in claim 49, further comprising: - a write-protection mechanism for write-protecting selected ones of the intermediate memory units that are mapped to the single instance.
52. A system as in claim 51, in which any and all of the intermediate memory units that are mapped to the single instance are write-protected. 53. A system as in claim 51, in which the memory sharing module is further provided for sensing a request by any virtual machine to write to any write-protected intermediate memory unit and, upon sensing such request, for the requesting virtual machine, for generating in the hardware memory a private copy of the write-protected intermediate memory unit and for remapping the write-protected intermediate memory unit to the private copy. 54. A system as in claim 51, in which the memory sharing module is provided for deferring the step of write-protecting each intermediate memory unit for which no other intermediate memory unit has yet been identified as having identical contents. 55. A system as in claim 49, in which the memory sharing module is provided for comparing the contents of each of the intermediate memory units with the contents of each of the other intermediate memory units. 56. A system as in claim 49, in which: - the virtual memory units are partitioned into a plurality of classes; and
- the memory sharing module is further provided for identifying virtual memory units that have identical contents and for mapping those virtual memory units to a single shared instance of a corresponding hardware memory unit separately and independently for each of the classes, whereby single instances of the hardware memory units are shared only among virtual memory units in the same class.
57. A system as in claim 56, in which the classes are page colors of the hardware memory units to which the corresponding virtual memory units are currently mapped. 58. A system as in claim 56, in which the computer system further has a multiprocessor architecture with a non-uniform memory access property and a plurality of memory modules having different access latency, and in which the classes are the memory modules to which the corresponding virtual memory units are currently mapped. 59. In a computer system that includes a hardware memory and at least one context, which has a virtual memory that is divided into a plurality of virtual memory units that are mappable to corresponding hardware memory units, a method comprising the following steps: - selecting candidate memory units from among the virtual memory units;
- identifying virtual memory units that have contents identical to the contents of the candidate memory units;
- identifying virtual memory units that have a relatively high probability of impending modification; and
- mapping those virtual memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units and write-protecting selected ones of the virtual memory units that are mapped to the single instance.
60. A method as in claim 59, further comprising the following steps: - designating as temporarily non-sharable the virtual memory units that have the relatively high probability of impending modification; and
- deferring the step of mapping to the single instance for the temporarily non-sharable virtual memory units.
61. A method as in claim 59, further comprising the following steps: - designating as temporarily non-sharable the virtual memory units that have the relatively high probability of impending modification; and
- deferring the step of write-protecting each temporarily non-sharable virtual memory unit until a subsequent identification of a different one of the virtual memory units having contents identical to the respective temporarily non-sharable virtual memory unit.
62. In a computer system that includes a hardware memory and at least one context, which has a virtual memory that is divided into a plurality of virtual memory units that are mappable to corresponding hardware memory units, a method comprising the following steps: - partitioning the virtual memory units into a plurality of classes;
- identifying virtual memory units that have identical contents;
- mapping those virtual memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units;
- performing the step of identifying virtual memory units that have identical contents and the step of mapping those virtual memory units to a single shared instance of a corresponding hardware memory unit separately and independently for each of the classes; and
- sharing single instances of the hardware memory units thereby taking place only among virtual memory units in the same class.
63. A method as in claim 62, in which the classes are page colors of the hardware memory units to which the corresponding virtual memory units are currently mapped. 64. A method as in claim 62, in which the computer system further has a multiprocessor architecture with a non-uniform memory access property and a plurality of memory modules having different access latency, and in which the classes are the memory modules to which the corresponding virtual memory units are currently mapped. 65. A method for sharing memory in a computer system comprising: - installing in the computer system at least one virtual machine that comprises:
- at least one address space that is divided into a plurality of virtual memory units; and
- a virtual operating system that maps each virtual memory unit to a corresponding intermediate memory unit;
- for each virtual machine, maintaining in a virtual machine monitor an intermediate mapping that maps each intermediate memory unit to a corresponding hardware memory unit of a hardware memory;
- selecting candidate memory units from among the intermediate memory units;
- identifying intermediate memory units that have contents identical to those of the candidate memory units;
- identifying intermediate memory units that have a relatively high probability of impending modification; and
- via the intermediate mapping, mapping those intermediate memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units;
- in which the step of mapping the intermediate memory units having identical contents further comprises write-protecting selected ones of the intermediate memory units that are mapped to the single instance.
66. A method as in claim 65, further comprising the following steps: - designating as temporarily non-sharable the intermediate memory units that have the relatively high probability of impending modification; and
- deferring the step of mapping to the single instance for the temporarily non-sharable intermediate memory units.
67. A method as in claim 65, further comprising the following steps: - designating as temporarily non-sharable the intermediate memory units that have the relatively high probability of impending modification; and
- deferring the step of write-protecting each temporarily non-sharable intermediate memory unit until a subsequent identification of a different one of the intermediate memory units having contents identical to the respective temporarily non-sharable intermediate memory unit.
68. A method for sharing memory in a computer system comprising: - installing in the computer system at least one virtual machine that comprises:
- at least one address space that is divided into a plurality of virtual memory units; and
- a virtual operating system that maps each virtual memory unit to a corresponding intermediate memory unit;
- for each virtual machine, maintaining in a virtual machine monitor an intermediate mapping that maps each intermediate memory unit to a corresponding hardware memory unit of a hardware memory;
- partitioning the intermediate memory units into a plurality of classes;
- identifying intermediate memory units that have identical contents;
- via the intermediate mapping, mapping those intermediate memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units;
- performing the step of identifying intermediate memory units that have identical contents and the step of mapping those intermediate memory units to a single shared instance of a corresponding hardware memory unit separately and independently for each of the classes; and
- sharing single instances of the hardware memory units thereby taking place only among intermediate memory units in the same class.
69. A method as in claim 68, in which the classes are page colors of the hardware memory units to which the corresponding intermediate memory units are currently mapped. 70. A method as in claim 68, in which the computer system further has a multiprocessor architecture with a non-uniform memory access property and a plurality of memory modules having different access latency, and in which the classes are the memory modules to which the corresponding intermediate memory units are currently mapped. 71. A computer system comprising: - a hardware memory;
- at least one context, which has a virtual memory that is divided into a plurality of virtual memory units that are mappable to corresponding hardware memory units; and
- a memory sharing module comprising computer-executable code for identifying virtual memory units that have identical contents and for mapping those virtual memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units;
- in which:
- the virtual memory units are partitioned into a plurality of classes; and
- the memory sharing module is further provided for identifying virtual memory units that have identical contents and for mapping those virtual memory units to a single shared instance of a corresponding hardware memory unit separately and independently for each of the classes, whereby single instances of the hardware memory units are shared only among virtual memory units in the same class.
72. A system as in claim 71, in which the classes are page colors of the hardware memory units to which the corresponding virtual memory units are currently mapped. 73. A system as in claim 71, in which the computer system further has a multiprocessor architecture with a non-uniform memory access property and a plurality of memory modules having different access latency, and in which the classes are the memory modules to which the corresponding virtual memory units are currently mapped. 74. A computer system comprising: - a hardware memory;
- at least one virtual machine that comprises:
- at least one address space that is divided into a plurality of virtual memory units; and
- a virtual operating system including means for mapping each virtual memory unit to a corresponding intermediate memory unit;
- for each virtual machine, a corresponding virtual machine monitor including intermediate mapping means for mapping each intermediate memory unit to a corresponding hardware memory unit of the hardware memory;
- a memory sharing module comprising computer-executable code for identifying intermediate memory units that have identical contents, and, via the intermediate mapping means, for mapping those intermediate memory units identified as having identical contents to a single instance of a corresponding one of the hardware memory units;
- in which:
- the virtual memory units are partitioned into a plurality of classes; and
- the memory sharing module is further provided for identifying virtual memory units that have identical contents and for mapping those virtual memory units to a single shared instance of a corresponding hardware memory unit separately and independently for each of the classes, whereby single instances of the hardware memory units are shared only among virtual memory units in the same class.
|