Patent ID: 7454448

Claim:
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.