# US 8,578,370 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,370 B2
- Document ID: US8578370B2
- Status: Granted
- Kind: B2
- Application number: 13/462,072
- Filed: 2012-05-02
- Published: 2012-08-23
- 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/US8578370B2

## 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

A method for managing virtual machines, the method comprising:
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;
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 2 (depends on 1)

The method of claim 1, 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 3 (depends on 1)

The method of claim 1, wherein the existing software hierarchy information of the installed virtual machines is maintained in the form of a tree map.

### Claim 4 (depends on 1)

The method of claim 1, wherein the existing software hierarchy information of the installed virtual machines is maintained in the form of a histogram.

### Claim 5 (depends on 1)

The method of claim 1, 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 6 (depends on 5)

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

### Claim 7 (depends on 1)

The method of claim 1 further comprising 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 8 (depends on 1)

The method of claim 1 further comprising:
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.
