# US 2013/0159639 A1 · Optimizing for Page Sharing in Virtualized Java Virtual Machines

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

- Number: US 2013/0159639 A1
- Document ID: US20130159639A1
- Status: Published application
- Kind: A1
- Application number: 13/715,539
- Filed: 2012-12-14
- Published: 2013-06-20
- Earliest claimed: 2011-12-14
- Assignees: VMware, Inc.
- Inventors: Benjamin J. CORRIE
- Web page: https://patentgrep.com/patent/US20130159639A1

## CPC

- G06F 12/00: Accessing, addressing or allocating within memory systems or architectures (digital input from, or digital output to record carriers, e.g. to disk storage units, G06F3/06)
- G06F 12/109: for multiple virtual address spaces, e.g. segmentation (G06F12/1036 takes precedence)
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F 2212/656: Address space sharing
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, systems, and computer programs manage memory of a runtime environment executing on a virtual machine. A runtime environment, such as a Java Virtual Machine, may deterministically arrange immutable data within memory such that a hypervisor may perform page sharing on the immutable data. The runtime environment may page-align the immutable data within memory. The runtime environment may further store the immutable within memory using self-referenced or self-relative pointers.

## Claims

### Claim 1

A method for managing memory of a runtime environment executing in a virtual machine, the method comprising:
generating immutable data associated with execution of an application in the runtime environment;
deterministically arranging the immutable data within a first memory page assigned to the runtime environment; and
notifying a virtualization layer that the first memory page containing the immutable data is a page sharing candidate.

### Claim 2 (depends on 1)

The method of claim 1, wherein the deterministically arranging the immutable data within the first memory page comprises:
aligning class data associated with the application to a boundary of the first memory page.

### Claim 3 (depends on 1)

The method of claim 1, wherein the deterministically arranging the immutable data within the first memory page comprises:
storing a relative reference to class data associated with the application within the first memory page.

### Claim 4 (depends on 1)

The method of claim 1, wherein the deterministically arranging the immutable data within the first memory page comprises:
aligning machine code to a boundary of the first memory page, wherein the machine code is compiled according to bytecode associated with the application.

### Claim 5 (depends on 1)

The method of claim 1, wherein the deterministically arranging the immutable data within the first memory page comprises:
storing a relative reference to machine code within a code cache of the runtime environment within the first memory page, wherein the machine code is compiled according to bytecode associated with the application.

### Claim 6

A computer system for executing an application on a host computer executing one or more virtual machines therein, the computer system comprising
a system memory comprising a plurality of machine memory pages; and
a virtualization layer configured to manage page sharing of the plurality of machine memory pages between the one or more virtual machines; and
at least one runtime environment executing in a first virtual machine, the runtime environment having immutable data arranged within one or more machine memory pages associated with the runtime environment such that the one or more machine memory pages may be shared with a process executing in a second virtual machine, wherein the immutable data is associated with execution of an application in the runtime environment.

### Claim 7 (depends on 6)

The computer system of claim 6, wherein the runtime environment is configured to align class data associated with the application to a boundary of the one or more machine memory pages.

### Claim 8 (depends on 6)

The computer system of claim 6, wherein the runtime environment is configured to store a relative reference to class data associated with the application within the one or more machine memory pages.

### Claim 9 (depends on 6)

The computer system of claim 6, wherein the runtime environment is configured to align machine code to a boundary of the one or more machine memory pages, wherein the machine code is compiled according to bytecode associated with the application.

### Claim 10 (depends on 6)

The computer system of claim 6, wherein the runtime environment is configured to store a relative reference to machine code within a code cache of the runtime environment within the one or more machine memory pages, wherein the machine code is compiled according to bytecode associated with the application.

### Claim 11

A non-transitory computer-readable storage medium comprising instructions that, when executed in a computing device, manage memory of a runtime environment executing in a virtual machine by performing the steps of:
generating immutable data associated with execution of an application in the runtime environment;
deterministically arranging the immutable data within a first memory page assigned to the runtime environment; and
notifying a virtualization layer that the first memory page containing the immutable data is a page sharing candidate.

### Claim 12 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein the instructions for deterministically arranging immutable data within the first memory page further comprises instructions for:
aligning class data associated with the application to a boundary of the first memory page.

### Claim 13 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein the instructions for deterministically arranging immutable data within the first memory page further comprises instructions for:
storing a relative reference to class data associated with the application within the first memory page.

### Claim 14 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein the instructions for deterministically arranging immutable data within the first memory page further comprises instructions for:
aligning machine code to a boundary of the first memory page, wherein the machine code is compiled according to bytecode associated with the application.

### Claim 15 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein the instructions for deterministically arranging immutable data within the first memory page further comprises instructions for:
storing a relative reference to machine code within a code cache of the runtime environment within the first memory page, wherein the machine code is compiled according to bytecode associated with the application.
