Garbage collector for a virtual heap
First Claim
1. A method for garbage collecting a virtual heap for a process executing within a virtual machine executing within a device, the method comprising:
- providing a store heap for the process, wherein the store heap is comprised in the virtual heap;
providing an in-memory heap for the process, wherein the in-memory heap comprises a cached portion of the store heap for the process, and wherein the in-memory heap is comprised in the virtual heap; and
a garbage collector process performing a generation of generational garbage collection on the virtual heap for the process executing within the virtual machine, wherein said performing the generation of garbage collection comprises;
flushing one or more sections of a first plurality of sections in the in-memory heap to a subset of a second plurality of sections in the store heap, wherein said flushing is performed when objects in the one or more sections have been modified since a previous garbage collection; and
performing garbage collection on the subset of the second plurality of sections in the store heap, wherein said garbage collection comprises;
removing objects not referenced by the process from the subset of the second plurality of sections.
3 Assignments
0 Petitions
Accused Products
Abstract
A method and system for performing generational garbage collection on a virtual heap in a virtual machine is provided. The garbage collection method is suited for use with small consumer and appliance devices that have a small amount of memory and may be using flash devices as persistent storage. The garbage collection method may provide good performance where only a portion of the virtual heap may be cached in the physical heap. The virtual heap may use a single address space for both objects in the store and the in-memory heap. In one embodiment, a single garbage collector is run on the virtual heap address space. The garbage collection method may remove non-referenced objects from the virtual heap. The garbage collection method may also include a compaction phase to reduce or eliminate fragmentation, and to improve locality of objects within the virtual heap. In one embodiment, the garbage collector for the virtual heap may be implemented as a generational garbage collector using working sets in the virtual heap, where each generation is confined to a working set of the heap. The generational garbage collector may allow the flushing of changes after each garbage collection cycle for each working set region. Heap regions with different flushing policies may be used. An object nursery region without flushing where objects are initially created may be used. When a garbage collection cycle is run, objects truly referenced in the object nursery may be copied back into heap regions to be flushed, while short-lived objects no longer referenced may be deleted without flushing.
-
Citations
51 Claims
-
1. A method for garbage collecting a virtual heap for a process executing within a virtual machine executing within a device, the method comprising:
-
providing a store heap for the process, wherein the store heap is comprised in the virtual heap;
providing an in-memory heap for the process, wherein the in-memory heap comprises a cached portion of the store heap for the process, and wherein the in-memory heap is comprised in the virtual heap; and
a garbage collector process performing a generation of generational garbage collection on the virtual heap for the process executing within the virtual machine, wherein said performing the generation of garbage collection comprises;
flushing one or more sections of a first plurality of sections in the in-memory heap to a subset of a second plurality of sections in the store heap, wherein said flushing is performed when objects in the one or more sections have been modified since a previous garbage collection; and
performing garbage collection on the subset of the second plurality of sections in the store heap, wherein said garbage collection comprises;
removing objects not referenced by the process from the subset of the second plurality of sections. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 50, 51)
-
-
19. A system comprising:
-
a device configured to execute a virtual machine, wherein the virtual machine is configured to execute a process;
a first memory coupled to the device, wherein the first memory is configured to store a store heap for the process, wherein the store heap is comprised within a virtual heap for the process;
a second memory coupled to the device, wherein the second memory is configured to store an in-memory heap for the process, wherein the in-memory heap is comprised within the virtual heap, wherein the in-memory heap comprises cached portions of the store heap for access by the process;
wherein the device is configured to perform garbage collection on the virtual heap according to a generational garbage collector process, wherein the generational garbage collector process is configured to;
perform a generation of garbage collection on the virtual heap for the process executing within the virtual machine;
wherein, in performing the generation of garbage collection, the generational garbage collector process is further configured to;
flush one or more sections of a first plurality of sections in the in-memory heap to a subset of a second plurality of sections in the store heap, wherein said flushing is performed when objects in the one or more sections have been modified since a previous garbage collection; and
perform garbage collection on the subset of the second plurality of sections in the store heap;
wherein, in performing garbage collection on the subset of the second plurality of sections in the store heap, the generational garbage collector process is further configured to;
remove objects not referenced by the process from the subset of the second plurality of sections. - View Dependent Claims (20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34)
-
-
35. A carrier medium comprising programming instructions executable to garbage collect a virtual heap for a process executing within a virtual machine executing within a device, wherein the program instructions are executable to implement:
-
providing a store heap for the process, wherein the store heap is comprised in the virtual heap;
providing an in-memory heap for the process, wherein the in-memory heap comprises a cached portion of the store heap for the process, and wherein the in-memory heap is comprised in the virtual heap; and
performing a generation of generational garbage collection on the virtual heap for the process executing within the virtual machine, wherein said performing the generation of garbage collection comprises;
flushing one or more sections of a first plurality of sections in the in-memory heap to a subset of a second plurality of sections in the store heap, wherein said flushing is performed when objects in the one or more sections have been modified since a previous garbage collection; and
performing garbage collection on the subset of the second plurality of sections in the store heap, wherein said garbage collection comprises;
removing objects not referenced by the process from the subset of the second plurality of sections. - View Dependent Claims (36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49)
-
Specification