Mechanism for enabling multiple processes to share physical memory
First Claim
1. A method implemented by a computer, wherein a first process is executing on the computer, the method comprising:
- initializing, in response to executing a first virtual machine (VM) instance on the computer, a first code cache associated with the first VM instance, wherein the computer comprises a persistent storage, a first virtual memory space, and a physical memory;
assigning the first virtual memory space to the first code cache;
obtaining, from the first VM instance, a persistent storage location;
determining that a mappable data structure does not exist at the persistent storage location;
obtaining, in response to the determining that the mappable data structure does not exist, a first component associated with the first VM instance and a second component associated with the first VM instance;
compiling the first component to obtain first compiled code stored in the first virtual memory space;
compiling the second component to obtain second compiled code stored in the first virtual memory space;
creating, at the persistent storage location, the mappable data structure;
storing the first compiled code and the second compiled code in the mappable data structure;
initializing, in response to executing a second virtual machine (VM) instance on the computer, a second code cache associated with the second VM instance, wherein the computer further comprises a second virtual memory space;
assigning the second virtual memory space to the second code cache;
obtaining, from the second VM instance, the persistent storage location;
determining that the mappable data structure exists at the persistent storage location;
determining that the mappable data structure is compatible with the second VM instance; and
mapping, in response to the determining that the mappable data structure is compatible with the second VM instance, the mappable data structure into the second virtual memory space.
2 Assignments
0 Petitions
Accused Products
Abstract
A mechanism is disclosed for enabling multiple processes to share the same portion of physical memory. The first time an instance of a process is executed, a list of common components is compiled. The compiled code is then written into a newly created mappable data structure, which is stored into persistent storage. The next time an instance of that process is executed, the mappable data structure is mapped into a portion of the process instance'"'"'s virtual memory space. This enables the process instance to invoke the compiled code for the common components. Multiple instances of the process may have their virtual memory spaces mapped to the same mappable data structure in this way. Thereafter, it is up to the operating system to load the contents of the mappable data structure into a portion of physical memory, and to ensure that all of the process instances share that physical memory portion.
33 Citations
19 Claims
-
1. A method implemented by a computer, wherein a first process is executing on the computer, the method comprising:
-
initializing, in response to executing a first virtual machine (VM) instance on the computer, a first code cache associated with the first VM instance, wherein the computer comprises a persistent storage, a first virtual memory space, and a physical memory; assigning the first virtual memory space to the first code cache; obtaining, from the first VM instance, a persistent storage location; determining that a mappable data structure does not exist at the persistent storage location; obtaining, in response to the determining that the mappable data structure does not exist, a first component associated with the first VM instance and a second component associated with the first VM instance; compiling the first component to obtain first compiled code stored in the first virtual memory space; compiling the second component to obtain second compiled code stored in the first virtual memory space; creating, at the persistent storage location, the mappable data structure; storing the first compiled code and the second compiled code in the mappable data structure; initializing, in response to executing a second virtual machine (VM) instance on the computer, a second code cache associated with the second VM instance, wherein the computer further comprises a second virtual memory space; assigning the second virtual memory space to the second code cache; obtaining, from the second VM instance, the persistent storage location; determining that the mappable data structure exists at the persistent storage location; determining that the mappable data structure is compatible with the second VM instance; and mapping, in response to the determining that the mappable data structure is compatible with the second VM instance, the mappable data structure into the second virtual memory space. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A machine readable storage medium comprising a set of instructions which, when executed by one or more processors, causes the one or more processors to perform the following operations:
-
initializing, in response to executing a first virtual machine (VM) instance on the computer, a first code cache associated with the first VM instance, wherein the computer comprises a persistent storage, a first virtual memory space, and a physical memory; assigning the first virtual memory space to the first code cache; obtaining, from the first VM instance, a persistent storage location; determining that a mappable data structure does not exist at the persistent storage location; obtaining, in response to the determining that the mappable data structure does not exist, a first component associated with the first VM instance and a second component associated with the first VM instance; compiling the first component to obtain first compiled code stored in the first virtual memory space; compiling the second component to obtain second compiled code stored in the first virtual memory space; creating, at the persistent storage location, the mappable data structure; storing the first compiled code and the second compiled code in the mappable data structure; initializing, in response to executing a second virtual machine (VM) instance on the computer, a second code cache associated with the second VM instance, wherein the computer further comprises a second virtual memory space; assigning the second virtual memory space to the second code cache; obtaining, from the second VM instance, the persistent storage location; determining that the mappable data structure exists at the persistent storage location; determining that the mappable data structure is compatible with the second VM instance; and mapping, in response to the determining that the mappable data structure is compatible with the second VM instance, the mappable data structure into the second virtual memory space. - View Dependent Claims (9, 10, 11, 12, 13)
-
-
14. An apparatus, comprising:
-
a persistent storage; one or more processors; a first virtual memory space; a second virtual memory space; a physical memory; and a set of instructions, which when executed by the one or more processors, causes the one or more processors to perform the following operations; initializing, in response to executing a first virtual machine (VM) instance on the apparatus, a first code cache associated with the first VM instance; assigning the first virtual memory space to the first code cache; obtaining, from the first VM instance, a persistent storage location; determining that a mappable data structure does not exist at the persistent storage location; obtaining, in response to the determining that the mappable data structure does not exist, a first component associated with the first VM instance and a second component associated with the first VM instance; compiling the first component to obtain first compiled code stored in the first virtual memory space; compiling the second component to obtain second compiled code stored in the first virtual memory space; creating, at the persistent storage location, the mappable data structure; storing the first compiled code and the second compiled code in the mappable data structure; initializing, in response to executing a second virtual machine (VM) instance on the apparatus, a second code cache associated with the second VM instance; assigning the second virtual memory space to the second code cache; obtaining, from the second VM instance, the persistent storage location; determining that the mappable data structure exists at the persistent storage location; determining that the mappable data structure is compatible with the second VM instance; and mapping, in response to the determining that the mappable data structure is compatible with the second VM instance, the mappable data structure into the second virtual memory space. - View Dependent Claims (15, 16, 17, 18, 19)
-
Specification