# US 8,578,369 B2 · Managing memory in multiple virtual machines

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,578,369 B2
- Document ID: US8578369B2
- Status: Granted
- Kind: B2
- Application number: 13/330,769
- Filed: 2011-12-20
- Published: 2012-06-28
- Granted: 2013-11-05
- Earliest claimed: 2010-12-23
- Assignees: International Business Machines Corporation
- Applicants: Xiao Jun Dai; Zhi Gan; Rui Bo Han; Xian Liu
- Inventors: Xiao Jun Dai; Zhi Gan; Rui Bo Han; Xian Liu
- Web page: https://patentgrep.com/patent/US8578369B2

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/5077: {Logical partitioning of resources; Management or configuration of virtualized resources (specific details on emulation or internal functioning of virtual machines G06F9/455)}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Virtual machines are managed by obtaining software hierarchy information of a current virtual machine to be installed. Then logical memory assigned to the current virtual machine is divided into a private part and a shared part based at least in part upon existing software hierarchy information of at least one virtual machine already installed and the software hierarchy information of the current virtual machine. Then, the shared part of the logical memory is mapped to shared segments of a physical memory, wherein the shared segments are used by at least one installed virtual machine.

## Claims

### Claim 1

An apparatus for managing virtual machines, the apparatus comprising:
a processor coupled to a physical memory, wherein the processor is programmed to manage virtual machines by implementing:
a virtual machine information obtaining unit that obtains software hierarchy information of a current virtual machine to be installed;
a memory analyzing unit that divides a logical memory assigned to the current virtual machine into a private part and a shared part based at least in part upon: existing software hierarchy information corresponding to installed virtual machines and the software hierarchy information of the current virtual machine;
wherein the memory analyzing unit further:
compares the software hierarchy information of the current virtual machine with the existing software hierarchy information;
determines which installed virtual machine among the installed virtual machines has software hierarchy information that is most similar with the software hierarchy information of the current virtual machine;
determines the common software hierarchy information between the software hierarchy information of the current virtual machine and the most similar software hierarchy information of the installed virtual machine;
based on the common software hierarchy information, divides the logical memory assigned to the current virtual machine into the private part and the shared part; and
relates the size of the shared part of the logical memory of the current virtual machine with the size of common software between the current virtual machine and the installed virtual machine having the most similar software hierarchy information, and the size of fixed memory segment that can be shared in the memory occupied by the common software; and
a memory mapping unit that maps the shared part of the logical memory assigned to the current virtual machine to shared segments of the physical memory, wherein the shared segments are used by at least one of the installed virtual machines.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the virtual machine information obtaining unit further obtains the software hierarchy information of the current virtual machine by reading header information of an installation file of the current virtual machine during the installation of the current virtual machine.

### Claim 3 (depends on 1)

The apparatus of claim 1, wherein the virtual machine information obtaining unit further maintains the existing software hierarchy information of the installed virtual machines in the form of a tree map.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the virtual machine information obtaining unit further maintains the existing software hierarchy information of the installed virtual machines in the form of a histogram.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the memory mapping unit further maintains a mapping table to record a mapping relation between the shared part of the logical memory of the current virtual machine and the shared segments of the physical memory.

### Claim 6 (depends on 5)

The apparatus of claim 5, wherein the mapping table further comprises a status bit to label a sharing status of each memory segment.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the memory mapping unit further releases, in response to a request to uninstall an installed virtual machine, the segments of the physical memory corresponding to the private part of the logical memory of the uninstalled virtual machine.

### Claim 8 (depends on 1)

The apparatus of claim 1, wherein the memory mapping unit further: creates, in response to a request from any virtual machine for modifying the shared part of the logical memory of the current virtual machine, new memory segments in the physical memory; copies data from the shared segments corresponding to the shared part of the logical memory of the current virtual machine to the new memory segments; and maps the shared part to the new memory segments.

### Claim 9

A computer-readable hardware with an executable program for managing virtual machines stored thereon, wherein the program instructs a processor to perform:
obtaining software hierarchy information of a current virtual machine to be installed;
dividing, using a processor, logical memory assigned to the current virtual machine into a private part and a shared part based at least in part upon: existing software hierarchy information of installed virtual machines and the software hierarchy information of the current virtual machine;
wherein the dividing the logical memory comprises:
comparing the software hierarchy information of the current virtual machine with the existing software hierarchy information;
determining which installed virtual machine among the installed virtual machines has software hierarchy information that is most similar with the software hierarchy information of the current virtual machine;
determining the common software hierarchy information between the software hierarchy information of the current virtual machine and the most similar software hierarchy information of the installed virtual machine;
based on the common software hierarchy information, dividing the logical memory assigned to the current virtual machine into the private part and the shared part;
relating the size of the shared part of the logical memory of the current virtual machine with the size of common software between the current virtual machine and the installed virtual machine having the most similar software hierarchy information, and the size of fixed memory segment that can be shared in the memory occupied by the common software; and
mapping, using the processor, the shared part of the logical memory of the current virtual machine to shared segments of a physical memory, wherein the shared segments are used by at least one of the installed virtual machines.

### Claim 10 (depends on 9)

The computer-readable hardware of claim 9, wherein obtaining the software hierarchy information of the current virtual machine further comprises obtaining the software hierarchy information of the current virtual machine by reading header information of an installation file during installation of the current virtual machine.

### Claim 11 (depends on 9)

The computer-readable hardware of claim 9, wherein the existing software hierarchy information of the installed virtual machines is maintained in the form of a tree map.

### Claim 12 (depends on 9)

The computer-readable hardware of claim 9, wherein the existing software hierarchy information of the installed virtual machines is maintained in the form of a histogram.

### Claim 13 (depends on 9)

The computer-readable hardware of claim 9, wherein mapping the shared part to the shared segments comprises, maintaining a mapping table to record the mapping relation between the shared part of the logical memory of the current virtual machine and the shared segments of the physical memory.

### Claim 14 (depends on 13)

The computer-readable hardware of claim 13, wherein the mapping table comprises a status bit to label a sharing status of each memory segment.

### Claim 15 (depends on 9)

The computer-readable hardware of claim 9, wherein the program further instructs the processor to perform: releasing, in response to a request to uninstall an installed virtual machine, the segments of the physical memory corresponding to the private part of the uninstalled virtual machine.

### Claim 16 (depends on 9)

The computer-readable hardware of claim 9, wherein the program further instructs the processor to perform: creating, in response to a request from any virtual machine to modify the shared part of the logical memory of the current virtual machine, new memory segments in the physical memory; copying data from the shared segments corresponding to the shared part of the logical memory of the current virtual machine to the new memory segments; and mapping the shared part to the new memory segments.
