Concurrent marking garbage collection with finger pointer
AssigneeInternational Business Machines Corporation
InventorsMichihiro Horie, Kazunori Ogata
Life of this patent
Estimating the term…
Abstract
A computer-implemented method, system, and computer program product are provided. The approach includes popping a first task from a queue of a garbage collection thread. The approach also includes identifying a second task from the popped first task, where the second task is associated with a bit of a bitmap and the bit is located at a location within the bitmap that has not yet been passed by a finger pointer. The approach also includes pushing the second task to the queue of the garbage collection thread.
Claims23
A computer-implemented method comprising:
- popping a first task from a queue of a garbage collection thread;
- iterating a finger pointer over a bitmap, wherein:
- the first task corresponds to a first bit at a first location that has been marked in the bitmap;
- locations not yet passed by the finger pointer correspond to tasks which have been marked but direct children have not yet been marked;
- and
- locations that have been passed by the finger pointer correspond to tasks which have been marked and direct children have been marked;
- identifying a reference object by scanning the first task;
- responsive to identifying the reference object, creating a second task from the popped first task, wherein:
- creating the second task comprises marking a second bit of the bitmap;
- the second task is associated with the second bit of the bitmap;
- and
- the second bit is located at a second location within the bitmap that has not yet been passed by the finger pointer;
- and
- responsive to identifying the bit at the second location within the bitmap that has not yet been passed by the finger pointer, pushing the second task to the queue of the garbage collection thread.
A computer-implemented method comprising:
- popping a first task from a queue of a garbage collection thread;
- iterating a finger pointer over a bitmap, wherein:
- the first task corresponds to a first bit at a first location that has been marked in the bitmap;
- locations not yet passed by the finger pointer correspond to tasks which have been marked but direct children have not yet been marked;
- and
- locations that have been passed by the finger pointer correspond to tasks which have been marked and direct children have been marked;
- identifying a reference object by scanning the first task;
- responsive to identifying the reference object, creating a second task and a third task from the popped first task;
- marking a second bit of the bitmap for the second task and a third bit of the bitmap for the third task, wherein:
- the second task is associated with the second bit of the bitmap;
- the second bit is located at a second location within the bitmap that has not yet been passed by the finger pointer;
- the third task is associated with the third bit of the bitmap;
- and
- the third bit is located at a third location within the bitmap that has been passed by the finger pointer;
- pushing the third task to the queue of the garbage collection thread;
- determining that a first number of tasks in the queue of the garbage collection thread is equal to or smaller than a first threshold number of tasks;
- and
- responsive to determining that the first number of tasks in the queue of the garbage collection thread is equal to or smaller than the first threshold number of tasks, pushing the second task to the queue of the garbage collection thread.
A computer program product comprising:
- one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions comprising:
- program instructions to pop a first task from a queue of a garbage collection thread;
- program instructions to iterate a finger pointer over a bitmap, wherein:
- the first task corresponds to a first bit at a first location that has been marked in the bitmap;
- locations not yet passed by the finger pointer correspond to tasks which have been marked but direct children have not yet been marked;
- and
- locations that have been passed by the finger pointer correspond to tasks which have been marked and direct children have been marked;
- program instructions to identify a reference object by scanning the first task;
- program instructions, responsive to identifying the reference object, to create a second task from the popped first task, wherein:
- program instructions to create the second task comprise program instructions to mark a second bit of the bitmap;
- the second task is associated with the second bit of the bitmap;
- and
- the second bit is located at a second location within the bitmap that has not yet been passed by the finger pointer;
- and
- program instructions to, responsive to identifying the bit at the second location within the bitmap that has not yet been passed by the finger pointer, push the second task to the queue of the garbage collection thread.
A computer program product comprising:
- one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions comprising:
- program instructions to pop a first task from a queue of a garbage collection thread;
- program instructions to iterate a finger pointer over a bitmap, wherein:
- the first task corresponds to a first bit at a first location that has been marked in the bitmap;
- locations not yet passed by the finger pointer correspond to tasks which have been marked but direct children have not yet been marked;
- and
- locations that have been passed by the finger pointer correspond to tasks which have been marked and direct children have been marked;
- program instructions to identify a reference object by scanning the first task;
- program instructions, responsive to identifying the reference object, create a second task and a third task from the popped first task by scanning the first task for reference objects;
- program instructions to mark a second bit of the bitmap for the second task and a third bit of the bitmap for the third task, wherein:
- the second task is associated with the second bit of the bitmap;
- the second bit is located at a second location within the bitmap that has not yet been passed by the finger pointer;
- the third task is associated with the third bit of the bitmap;
- and
- the third bit is located at a third location within the bitmap that has been passed by the finger pointer;
- program instructions to push the third task to the queue of the garbage collection thread;
- program instructions to determine that a first number of tasks in the queue of the garbage collection thread is equal to or smaller than a first threshold number of tasks;
- and
- program instructions to, responsive to determining that the first number of tasks in the queue of the garbage collection thread is equal to or smaller than the first threshold number of tasks, push the second task to the queue of the garbage collection thread.
A computer system comprising:
- one or more computer processors, including one or more threads, one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media for execution by at least one of the one or more computer processors, the program instructions comprising:
- program instructions to pop a first task from a queue of a garbage collection thread;
- program instructions to iterate a finger pointer over a bitmap, wherein:
- the first task corresponds to a first bit at a first location that has been marked in the bitmap;
- locations not yet passed by the finger pointer correspond to tasks which have been marked but direct children have not yet been marked;
- and
- locations that have been passed by the finger pointer correspond to tasks which have been marked and direct children have been marked;
- program instructions to identify a reference object by scanning the first task;
- program instructions, responsive to identifying the reference object, to create a second task from the popped first task, wherein:
- program instructions to create the second task comprise program instructions to mark a second bit of the bitmap;
- the second task is associated with the second bit of the bitmap;
- and
- the second bit is located at a second location within the bitmap that has not yet been passed by the finger pointer;
- and
- program instructions to, responsive to identifying the bit at the second location within the bitmap that has not yet been passed by the finger pointer, push the second task to the queue of the garbage collection thread.
Dependencies are inferred from the claim text.