IP Library Granted Patent US 7,454,448
Granted Patent B1
US 7,454,448 · App. 11/105,830 · Granted Nov 18, 2008

Synchronizing object promotion in a multi-tasking virtual machine with generational garbage collection

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,454,448
App. No.
11/105,830
Granted
Nov 18, 2008
Kind
B1
Abstract

A method for managing memory in a multi-tasking virtual machine, involving suspending a first task for garbage collection of a plurality of concurrently executing tasks, promoting at least one object associated with the first task to a old generation using a gap buffer to obtain a promoted object, wherein the gap buffer stores a gap created by objects directly allocated by at least one of the plurality of concurrently executing tasks, locating the promoted object using the gap buffer, traversing the promoted object to determine whether a first referenced object exist, and promoting the first referenced object using the gap buffer, if the first referenced object exists.

Claims (70)

1. A method for managing memory in a multi-tasking virtual machine, comprising:

suspending a first task for garbage collection of a plurality of concurrently executing tasks;

promoting at least one object associated with the first task to a old generation using a gap buffer to obtain a promoted object, wherein the gap buffer stores a gap created by objects directly allocated by at least one of the plurality of concurrently executing tasks, wherein directly allocated objects are objects that are allocated to the old generation upon creation and without surviving a garbage collection;

locating the promoted object using the gap buffer;

traversing the promoted object to determine whether a first referenced object exists; promoting the first referenced object using the gap buffer, if the first referenced object exists;

initializing the gap buffer, wherein the gap buffer comprises a pointer to a lower bound and a pointer to an upper bound of the gap; and

initializing a value of a upper bound of a last promoted object, wherein the upper bound of the last promoted object references a memory address associated with the completion of a promotion in the old generation,

wherein a current object pointer references the promoted object in the old generation,

wherein a gap buffer pointer references a current gap in the gap buffer, and

wherein locating the promoted object comprises:

comparing the current object pointer to a lower bound of the current gap; and

passing over the current gap created by concurrently executing tasks, wherein the current gap is created when one of the concurrently executing tasks directly allocates an object to the old generation, if the current object pointer is equal to the lower bound of the current gap, wherein passing over the current gap comprises updating the current object pointer to reference an upper bound of the current gap.

2. The method of claim 1 , wherein promoting the first referenced object comprises promoting from a private young generation to a shared old generation for the first task while other tasks are concurrently executing.

3. The method of claim 1 , further comprising:

traversing the promoted object to determine whether a second referenced object exists;

promoting the second referenced object using the gap buffer, if the second referenced object exists.

4. The method of claim 1 , further comprising:

traversing the first referenced object to determine whether a second referenced object exists;

promoting the second referenced object using the gap buffer, if the second referenced object exists.

5. The method of claim 1 , further comprising:

storing a scan upper bound, wherein the scan upper bound indicates an ending address for an iteration, wherein the iteration comprises scanning the promoted object and traversing the promoted object to promote a set of referenced objects, and wherein the iteration completes when the scan upper bound is reached.

6. The method of claim 1 , wherein said promoting at least one object comprises:

allocating an allocated space in the old generation using a size of the at least one object;

copying the at least one object to the allocated space;

determining if a gap was inserted and updating the gap buffer; and

updating an upper bound of a last promoted object to the upper bound of the allocated space.

7. The method of claim 6 , wherein updating the gap buffer comprises:

comparing the upper bound of the last promoted object to an address of a new promoted object, wherein the new promoted object is the allocated space; and

if the upper bound of the last promoted object is not equal to the address of the new promoted object:

recording a lower bound in the gap buffer, wherein the lower bound is the upper bound of the last promoted object; and

recording an upper bound in the gap buffer, wherein the upper bound is the address of the new promoted object.

8. The method of claim 1 , further comprising:

resuming the first task, wherein the first task is resumed when the current object pointer is equal to the upper bound of the last promoted object.

9. A system, comprising:

a processor;

a memory;

a plurality of concurrently executing tasks executing on the processor, wherein each of the plurality of concurrently executing tasks is associated with a private young generation memory;

a virtual machine configured to execute the plurality of concurrently executing tasks on the processor; and

an automatic memory management system (AMMS) operatively connected to the virtual machine and configured to:

manage the memory;

suspend a first task of a plurality of concurrently executing tasks;

promote at least one object associated with the first task to an old generation located in the memory using a gap buffer to obtain a promoted object, wherein the gap buffer stores a gap inserted by objects directly allocated by at least one of the plurality of concurrently executing tasks, and wherein directly allocated objects are objects that are allocated to the old generation upon creation and without surviving a garbage collection;

locate the promoted object using the gap buffer;

traverse the promoted object to determine whether a first referenced object exists;

promote the first referenced object using the gap buffer, if the first referenced object exists;

initialize the gap buffer, wherein the gap buffer comprises a pointer to a lower bound and a pointer to an upper bound of the gap; and

initialize a value of an upper bound of a last promoted object, wherein the upper bound of the last promoted object references a memory address associated with the completion of a promotion in the old generation,

wherein a current object pointer references the promoted object in the old generation,

wherein a gap buffer pointer references a current gap in the gap buffer, and

wherein locating the promoted object comprises:

comparing the current object pointer to a lower bound of the current gap; and

passing over the current gap created by concurrently executing tasks, wherein the current gap is created when one of the concurrently executing tasks directly allocates an object to the old generation, if the current object pointer is equal to the lower bound of the current gap, wherein passing over the current gap comprises updating the current object pointer to reference an upper bound of the current gap.

10. The system of claim 9 , wherein the AMMS is further configured to:

traverse the promoted object to determine whether a second referenced object exists;

promote the second referenced object using the gap buffer, if the second referenced object exists.

11. The system of claim 9 , wherein the AMMS is further configured to:

traverse the first referenced object to determine whether a second referenced object exists;

promote the second referenced object using the gap buffer, if the second referenced object exists.

12. The system of claim 9 , wherein said promoting at least one object comprises:

allocating an allocated space in the old generation using a size of the at least one object;

copying the at least one object to the allocated space;

determining if a gap was inserted and updating the gap buffer; and

updating an upper bound of a last promoted object to an upper bound of the allocated space.

13. The system of claim 12 , wherein updating the gap buffer comprises:

comparing the upper bound of the last promoted object to an address of a new promoted object, wherein the new promoted object is the allocated space; and

if the upper bound of the last promoted object is not equal to the address of the new promoted object:

recording a lower bound in the gap buffer, wherein the lower bound is the upper bound of the last promoted object; and

recording an upper bound in the gap buffer, wherein the upper bound is the address of the new promoted object.

14. The system of claim 9 , wherein the AMMS is further configured to:

resume the first task, wherein the first task is resumed when the current object pointer is equal to a free space pointer.

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 037303/0926 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 14, 2005
From: DAYNES, LAURENT PHILIPPE; MCCLURE, ANDREW; CZAJKOWSKI, GRZEGORZ JAN
To: SUN MICROSYSTEMS, INC.
Reel/Frame 016487/0846 →