Patent ID: 7584231

Claim:
A method enabling concurrent garbage collection of a young generation of a task with other tasks executing in a multi-tasking virtual machine defined by one of a plurality of virtual machines operating in a computer system, comprising method operations of: providing a pointer for each of a plurality of threads of the task whose value references a free space memory address in an old generation memory which determines an end of scan value for the task before garbage collection of the young generation associated with the task, wherein the garbage collection preserves live objects in a memory of the virtual machine; maintaining the value of the pointer associated with each of the plurality of threads in a local storage area of each thread associated with the task, the value of the pointer defining a end of scan position of a last object allocated by each thread associated with the task in the old generation memory; providing a counter of the number of ongoing object initializations, the counter being atomically incremented before an object allocation in the old generation memory and atomically decremented after initialization of an object of the old generation memory; and regulating garbage collection of the young generation of the task while the other tasks of the multi-tasking virtual machine are executing, wherein the value of the pointer associated with the task and the counter are used in regulating the garbage collection of the young generation of the task based on the number of ongoing object initializations within the counter, wherein the end of scan position is defined by iterating over each of the plurality of threads of the task to determine a maximum value of the pointer, the maximum value of the pointer used as the end of scan position during garbage collection of the young generation of the task.