IP Library Granted Patent US 7,882,198
Granted Patent B2
US 7,882,198 · App. 11/824,850 · Granted Feb 1, 2011

Shared JAVA JAR files

Assignee: Oracle America, Inc.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,882,198
App. No.
11/824,850
Granted
Feb 1, 2011
Kind
B2
Abstract

Techniques are disclosed for sharing programmatic modules among isolated virtual machines. A master JVM process loads data from a programmatic module, storing certain elements of that data into its private memory region, and storing other elements of that data into a “read-only” area of a shareable memory region. The master JVM process copies loaded data from its private memory region into a “read/write” area of the shareable memory region. Instead of re-loading the data from the programmatic module, other JVM processes map to the read-only area and also copy the loaded data from the read/write area into their own private memory regions. The private memory areas of all of the JVM processes begin at the same virtual memory address, so references between read-only data and copied data are preserved correctly. As a result, multiple JVM processes start up faster, and memory is conserved by avoiding the redundant storage of shareable data.

Claims (61)

1. A machine-implemented method for sharing programmatic modules among isolated virtual machines, the method comprising:

copying, from a shareable memory region that is readable by multiple isolated virtual machines, into a first private memory region of a first virtual machine, first data that a second virtual machine (a) loaded from a programmatic module, (b) stored into a second private memory region of the second virtual machine, and (c) copied, from the second private memory region, into the shareable memory region; and

establishing a mapping between the first virtual machine and a particular area of the shareable memory region that comprises second data that the second virtual machine (a) loaded from the programmatic module and (b) stored into the particular area of the shareable memory region;

wherein the mapping enables the first virtual machine to read the second data without creating a copy of the second data in any private memory region of the first virtual machine,

wherein the first private memory region and the second private memory region both begin at a same virtual address, and

wherein:

prior to a time at which the first data exists in the shareable memory region, a reference in the second data refers to a particular virtual memory address within a copy of the first data that is in the second private memory region; and

after a time at which the first data exists in the first private memory region, the reference in the second data also refers to the same particular virtual memory address within a copy of the first data that is the first private memory region.

2. The method of claim 1 , wherein the first data comprises data that the second virtual machine processed, from a first form that is not usable by the first virtual machine at runtime, into a second form that is usable by both the first virtual machine and the second virtual machine at runtime.

3. The method of claim 1 , wherein the programmatic module is a JAVA JAR file, and wherein the first data corresponds to at least one JAVA class.

4. The method of claim 1 , wherein, after the first data has been copied into the first private memory region, the second data comprises at least one reference that refers to both (a) a virtual address in the first private memory region and (b) a same virtual address in the second private memory region.

5. The method of claim 1 , further comprising:

the first virtual machine using the first data and the second data to execute a program without ever loading any data directly from the programmatic module.

6. The method of claim 1 , wherein:

the first data represents mutable entities; and

the second data represents immutable entities, but does not represent any mutable entities.

7. The method of claim 1 , wherein:

as part of loading the first data from the programmatic module, a second virtual machine selects, from among a plurality of different function pointer vectors, a particular function pointer vector that corresponds to at least one of: (a) a class loader that loads data from the programmatic module and (b) the programmatic module; and

as part of loading the first data from the programmatic module, the second virtual machine calls one or more functions to which the particular function pointer vector refers.

8. The method of claim 1 , wherein:

as part of loading the first data from the programmatic module, the second virtual machine selects, from among a plurality of separate shareable memory regions, a particular shareable memory region that corresponds to the programmatic module and no other programmatic module; and

the second virtual machine copies data from the second private memory region into the particular shareable memory region.

9. A non-transitory machine-readable medium carrying one or more sequences of instructions, which instructions, when executed by one or more processors, cause the one or more processors to carry out steps comprising:

copying, from a shareable memory region that is readable by multiple isolated virtual machines, into a first private memory region of a first virtual machine, first data that a second virtual machine (a) loaded from a programmatic module, (b) stored into a second private memory region of the second virtual machine, and (c) copied, from the second private memory region, into the shareable memory region; and

establishing a mapping between the first virtual machine and a particular area of the shareable memory region that comprises second data that the second virtual machine (a) loaded from the programmatic module and (b) stored into to the particular area of the shareable memory region;

wherein the mapping enables the first virtual machine to read the second data without creating a copy of the second data in any private memory region of the first virtual machine,

wherein the first private memory region and the second private memory region both begin at a same virtual address, and

wherein:

prior to a time at which the first data exists in the shareable memory region, a reference in the second data refers to a particular virtual memory address within a copy of the first data that is in the second private memory region; and

after a time at which the first data exists in the first private memory region, the reference in the second data also refers to the same particular virtual memory address within a copy of the first data that is the first private memory region.

10. The non-transitory machine-readable medium of claim 9 , wherein the first data comprises data that the second virtual machine processed, from a first form that is not usable by the first virtual machine at runtime, into a second form that is usable by both the first virtual machine and the second virtual machine at runtime.

11. The non-transitory machine-readable medium of claim 9 , wherein the programmatic module is a JAVA JAR file, and wherein the first data corresponds to at least one JAVA class.

12. The non-transitory machine-readable medium of claim 9 , wherein, after the first data has been copied into the first private memory region, the second data contains at least one reference that refers to both (a) a virtual address in the first private memory region and (b) a same virtual address in the second private memory region.

13. The non-transitory machine-readable medium of claim 9 , wherein the steps further comprise:

the first virtual machine using the first data and the second data to execute a program without ever loading any data directly from the programmatic module.

14. The non-transitory machine-readable medium of claim 9 , wherein:

the first data represents mutable entities; and

the second data represents immutable entities, but does not represent any mutable entities.

15. The non-transitory machine-readable medium of claim 9 , wherein:

as part of loading the first data from the programmatic module, the second virtual machine selects, from among a plurality of different function pointer vectors, a particular function pointer vector that corresponds to at least one of: (a) a class loader that loads data from the programmatic module and (b) the programmatic module; and

as part of loading the first data from the programmatic module, the second virtual machine calls one or more functions to which the particular function pointer vector refers.

16. The non-transitory machine-readable medium of claim 9 , wherein:

as part of loading the first data from the programmatic module, the second virtual machine selects, from among a plurality of separate shareable memory regions, a particular shareable memory region that corresponds to the programmatic module and no other programmatic module in the plurality; and

the second virtual machine copies data from the second private memory region into the particular shareable memory region.

17. A system comprising:

a programmatic module;

a first virtual machine that (a) loads first data from the programmatic module into a first private memory region of the first virtual machine, (b) loads second data from the programmatic module into a shareable memory region, and (c) copies a processed version of the first data from the first private memory region into the shareable memory region; and

a second virtual machine that (a) maps to the second data in the shareable memory region and (b) loads the processed version of the first data from the shareable memory region into a second private memory region of the second virtual machine;

wherein the first virtual machine is isolated from the second virtual machine, and

wherein:

prior to a time at which the first data exists in the shareable memory region, a reference in the second data refers to a particular virtual memory address within a copy of the first data that is in the first private memory region; and

after a time at which the first data exists in the second private memory region, the reference in the second data also refers to the same particular virtual memory address within a copy of the first data that is the second private memory region.

18. The system of claim 17 , wherein:

the first private memory region begins at a particular virtual address; and

the second private memory region also begins at the particular virtual address;

wherein the first and second private memory regions begin at different physical addresses.

19. The system of claim 18 , wherein:

the second data in the shareable memory region contains one or more references to virtual addresses in a virtual address region that begins at the particular virtual address.

20. The system of claim 18 , further comprising:

a third virtual machine that (a) maps to the second data in the shareable memory region and (b) loads the processed version of the first data from the shareable memory region into a third private memory region of the third virtual machine;

wherein the third virtual machine is isolated from the first and second virtual machines.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037311/0056 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 2, 2007
From: LANDAU, EREZ; LONG, DEAN R. E.; FRESKO, NEDIM
To: SUN MICROSYSTEMS, INC.
Reel/Frame 019579/0044 →
Continuity (1)
Related Publication 20100023702A1 · Jan 28, 2010