Search Images Maps Play YouTube News Gmail Drive More »
Advanced Patent Search | Web History | Sign in

Patents

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.

InventorCarl A. Waldspurger
Original AssigneeVMWare, Inc.
Primary Examiner: Mano Padmanabhan
Secondary Examiner: Jasmine Song
Attorney: Jeffrey Pearce
Current U.S. Classification711/6; 711/202; 711/203; 711/206; 711/216; 711/E12.068; 718/1
International Classification: G06F/1202

View patent at USPTO
Search USPTO Assignment Database
Download USPTO Public PAIR data

Citations

Cited PatentFiling dateIssue dateOriginal AssigneeTitle
US5757919Dec 12, 1996May 26, 1998Intel CorporationCryptographically protected paging subsystem
US6075938Jun 10, 1998Jun 13, 2000The Board of Trustees of the Leland Stanford Junior UniversityVirtual machine monitors for scalable multiprocessors
US6138113Aug 10, 1998Oct 24, 2000AltaVista CompanyMethod for identifying near duplicate pages in a hyperlinked database
US6233668Oct 27, 1999May 15, 2001Compaq Computer CorporationConcurrent page tables
US6349355Feb 6, 1997Feb 19, 2002Microsoft CorporationSharing executable modules between user and kernel threads
US6374266Jul 24, 1999Apr 16, 2002Method and apparatus for storing information in a data processing system
US6496847Sep 10, 1998Dec 17, 2002VMWare, Inc.System and method for virtualizing computer systems
US6560688Oct 1, 1998May 6, 2003Advanced Micro Devices, Inc.System and method for improving accelerated graphics port systems
US6567907Oct 19, 2000May 20, 2003Hewlett-Packard Development Company L.P.Avoiding mapping conflicts in a translation look-aside buffer
US6581142Sep 1, 2000Jun 17, 2003International Business Machines CorporationComputer program product and method for partial paging and eviction of microprocessor instructions in an embedded computer
US20020099946Apr 30, 1998CRYPTOGRAPHICALLY PROTECTED PAGING SUBSYSTEM
US20020174315May 16, 2001Load distribution of multiple disks

Referenced by

Citing PatentFiling dateIssue dateOriginal AssigneeTitle
US6880022Apr 19, 2004Apr 12, 2005VMware, Inc.Transparent memory address remapping
US6895491Sep 26, 2002May 17, 2005Hewlett-Packard Development Company, L.P.Memory addressing for a virtual machine implementation on a computer processor supporting virtual hash-page-table searching
US6907600Dec 27, 2000Jun 14, 2005Intel CorporationVirtual translation lookaside buffer
US6986006Apr 17, 2002Jan 10, 2006Microsoft CorporationPage granular curtained memory via mapping control
US7035963Dec 27, 2000Apr 25, 2006Intel CorporationMethod for resolving address space conflicts between a virtual machine monitor and a guest operating system
US7043494Jan 28, 2003May 9, 2006PMC-Sierra, Inc.Fast, deterministic exact match look-ups in large tables
US7203944Jul 9, 2003Apr 10, 2007VERITAS Operating CorporationMigrating virtual machines among computer systems to balance load caused by virtual machines
US7213246Mar 28, 2002May 1, 2007Veritas Operating CorporationFailing over a virtual machine
US7246200Nov 12, 2003Jul 17, 2007VERITAS Operating CorporationProvisioning and snapshotting using copy on read/write and transient virtual machine technology
US7254673Dec 30, 2004Aug 7, 2007EMC CorporationProvision of a victim cache within a storage cache hierarchy
US7266637Apr 9, 2004Sep 4, 2007VERITAS Operating CorporationStorage management system
US7272831Mar 30, 2001Sep 18, 2007Intel CorporationMethod and apparatus for constructing host processor soft devices independent of the host processor operating system
US7302514Jun 15, 2004Nov 27, 2007Intel CorporationDevice, system, and method of virtual machine memory mapping
US7313669Feb 28, 2005Dec 25, 2007Intel CorporationVirtual translation lookaside buffer
US7334076Mar 8, 2005Feb 19, 2008Microsoft CorporationMethod and system for a guest physical address virtualization in a virtual machine environment
US7373451Dec 8, 2004May 13, 2008The Board of Trustees of the Leland Stanford Junior UniversityCache-based system management architecture with virtual appliances, network repositories, and virtual appliance transceivers
US7441092Apr 20, 2006Oct 21, 2008Microsoft CorporationMulti-client cluster-based backup and restore
US7441097Sep 10, 2003Oct 21, 2008Seagate Technology LLCData storage system and method for adaptive reconstruction of a directory structure
US7444499Mar 28, 2006Oct 28, 2008Sun Microsystems, Inc.Method and system for trace generation using memory index hashing
US7447857Feb 28, 2008Nov 4, 2008Microsoft CorporationMulti-client cluster-based backup and restore
US7448079Jul 3, 2001Nov 4, 2008Ernst & Young, LLPMethod and apparatus for providing computer services
US7454477May 16, 2005Nov 18, 2008Microsoft CorporationZero-copy transfer of memory between address spaces
US7487307Jan 5, 2006Feb 3, 2009International Business Machines CorporationMethod, apparatus and program product for managing memory in a virtual computing system
US7500048Sep 22, 2006Mar 3, 2009VMware, Inc.Transparent page sharing on commodity operating systems
US7533229Jun 12, 2006May 12, 2009Symantec Operating CorporationDisaster recovery and backup using virtual machines
US7555620Apr 28, 2006Jun 30, 2009Network Appliance, Inc.Method and system of using a backup image for multiple purposes
US7571274Dec 30, 2004Aug 4, 2009Intel CorporationMethod and system for virtual enclosure management
US7596654Jan 26, 2006Sep 29, 2009Symantec Operating CorporationVirtual machine spanning multiple computers
US7603670Mar 28, 2002Oct 13, 2009Symantec Operating CorporationVirtual machine transfer between computer systems
US7607011Jul 16, 2004Oct 20, 2009Rockwell Collins, Inc.System and method for multi-level security on a network
US7636824Jun 4, 2007Dec 22, 2009Acronis Inc.System and method for efficient backup using hashes
US7636831Mar 31, 2006Dec 22, 2009VMware, Inc.Optimization of reverse mappings for immutable guest physical pages of virtual memories in a virtualized computer system
US7644246Dec 9, 2005Jan 5, 2010Microsoft CorporationUsing limits on address translation to control access to an addressable entity
US7647589May 31, 2005Jan 12, 2010Parallels Software International, Inc.Methods and systems for safe execution of guest code in virtual machine context
US7650478Dec 9, 2005Jan 19, 2010Microsoft CorporationUsing limits on address translation to control access to an addressable entity
US7653794May 8, 2006Jan 26, 2010Microsoft CorporationConverting physical machines to virtual machines
US7702843Sep 21, 2006Apr 20, 2010VMware, Inc.Determining memory conditions in a virtual machine
US7716446Sep 21, 2006May 11, 2010VMware, Inc.System and method for cooperative virtual machine memory scheduling
US7716667Feb 13, 2007May 11, 2010Symantec Operating CorporationMigrating virtual machines among computer systems to balance load caused by virtual machines
US7769826Jun 26, 2003Aug 3, 2010Nominum, Inc.Systems and methods of providing DNS services using separate answer and referral caches
US7793287Oct 1, 2003Sep 7, 2010Hewlett-Packard Development Company, L.P.Runtime virtualization and devirtualization of I/O devices by a virtual machine monitor
US7797507Jul 25, 2007Sep 14, 2010NEC CorporationVirtual machine system and operating method thereof
US7805723Oct 1, 2003Sep 28, 2010Hewlett-Packard Development Company, L.P.Runtime virtualization and devirtualization of memory by a virtual machine monitor
US7809875Jun 30, 2008Oct 5, 2010Wind River Systems, Inc.Method and system for secure communication between processor partitions
US7809888Jun 22, 2005Oct 5, 2010EMC CorporationContent-aware caching techniques
US7810092Mar 2, 2004Oct 5, 2010Symantec Operating CorporationCentral administration and maintenance of workstations using virtual machines, network filesystems, and replication
US7814328Sep 12, 2005Oct 12, 2010Microsoft CorporationDigital signatures for embedded code
US7814491Apr 14, 2004Oct 12, 2010Oracle America, Inc.Method and apparatus for managing system resources using a container model
US7865893Feb 7, 2006Jan 4, 2011Parallels Holdings, Ltd.System and method for starting virtual machine monitor in common with already installed operating system
US7877570Aug 14, 2007Jan 25, 2011Red Hat, Inc.Consolidation of matching memory pages
US7877734Jan 12, 2006Jan 25, 2011International Business Machines CorporationSelective profiling of program code executing in a runtime environment
US7890689Mar 6, 2008Feb 15, 2011The Board of Trustees of the Leland Stanford Junior UniversityVirtual appliance management
US7890712Dec 31, 2008Feb 15, 2011International Business Machines CorporationMethod, apparatus and program product for managing memory in a virtual computing system
US7900002Mar 3, 2008Mar 1, 2011Microsoft CorporationMulti-client cluster-based backup and restore
US7913226Oct 1, 2003Mar 22, 2011Hewlett-Packard Development Company, L.P.Interposing a virtual machine monitor and devirtualizing computer hardware at runtime
US7925850Feb 16, 2007Apr 12, 2011VMware, Inc.Page signature disambiguation for increasing the efficiency of virtual machine migration in shared-page virtualized computer systems
US7958374Jun 18, 2007Jun 7, 2011Shansun Technology CompanyDigital information protecting method and apparatus, and computer accessible recording medium
US7984264Nov 6, 2009Jul 19, 2011VMware, Inc.Maintaining reverse mappings in a virtualized computer system
US7987432Apr 24, 2007Jul 26, 2011Parallels Holdings, Ltd.Seamless integration and installation of non-native application into native operating system
US7995584Jun 19, 2008Aug 9, 2011Hewlett-Packard Development Company, L.P.Method and apparatus for detecting malicious routers from packet payload
US7996548Dec 30, 2008Aug 9, 2011Intel CorporationMessage communication techniques
US8015367Feb 16, 2007Sep 6, 2011VMware, Inc.Memory management methods in a computer system with shared memory mappings
US8024742Sep 30, 2004Sep 20, 2011Jaluna 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
US8037279Jun 12, 2008Oct 11, 2011Oracle America, Inc.Method and system for cross-domain data sharing
US8051111Jan 31, 2008Nov 1, 2011Prowess Consulting, LLCMethod and system for modularizing windows imaging format
US8056076Jun 29, 2006Nov 8, 2011VMware, Inc.Method and system for acquiring a quiesceing set of information associated with a virtual machine
US8060747Mar 20, 2006Nov 15, 2011Microsoft CorporationDigital signatures for embedded code
US8074047May 16, 2008Dec 6, 2011International Business Machines CorporationSystem and method for content replication detection and elimination in main memory
US8095931Sep 21, 2006Jan 10, 2012VMware, Inc.Controlling memory conditions in a virtual machine
US8108560Nov 22, 2005Jan 31, 2012Hewlett-Packard Development Company, L.P.Method and apparatus for managing data transfer in a computer memory
US8112585Apr 30, 2009Feb 7, 2012NetApp, Inc.Method and apparatus for dynamically switching cache policies
US8117554Mar 15, 2009Feb 14, 2012Parallels Holdings, Ltd.Seamless integration of non-native widgets and windows with dynamically scalable resolution into native operating system
US8135899Apr 11, 2011Mar 13, 2012Parallels IP Holdings GmbHExpansion of virtualized physical memory of virtual machine
US8151026Aug 31, 2010Apr 3, 2012Wind River Systems, Inc.Method and system for secure communication between processor partitions
US8151263Mar 19, 2007Apr 3, 2012VMware, Inc.Real time cloning of a virtual machine
US8166253Aug 12, 2011Apr 24, 2012VMware, Inc.Memory management system in a computer system with shared memory mappings
US8176279Mar 20, 2008May 8, 2012International Business Machines CorporationManaging use of storage by multiple pageable guests of a computing environment
US8176280Mar 20, 2008May 8, 2012International Business Machines CorporationUse of test protection instruction in computing environments that support pageable guests
US8176488Dec 25, 2009May 8, 2012Parallels IP Holdings GmbHMethods and systems for determining potentially unsafe instructions in a virtual machine context and activating a software debugger to process the potentially unsafe instructions
US8190827Feb 27, 2009May 29, 2012Red Hat, Inc.Memory sharing among computer programs
US8190902Feb 27, 2006May 29, 2012Microsoft CorporationTechniques for digital signature formation and verification
US8201170Apr 7, 2004Jun 12, 2012Jaluna SAOperating systems are executed on common program and interrupt service routine of low priority OS is modified to response to interrupts from common program only
US8205087Feb 27, 2006Jun 19, 2012Microsoft CorporationTool for digitally signing multiple documents
US8230203Mar 30, 2007Jul 24, 2012Intel CorporationDetecting spin loops in a virtual machine environment
US8234655Jul 29, 2008Jul 31, 2012International Business Machines CorporationDetection of duplicate memory pages across guest operating systems on a shared host

Claims

1. 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.