Per thread garbage collection
AssigneeApple Inc.
InventorsGerald Blaine Garst Jr., Gregory Robert Parker, Douglas Joshua Behnke, Patrick C. Beard
Life of this patent
Estimating the term…
Abstract
Per thread garbage collection is disclosed. Objects associated only with a thread that created them are tracked. At a garbage collection time for a particular thread, it is determined which objects associated only with that thread remain reachable from a restricted root set associated with the thread. Any thread-only objects that are not determined to be reachable are garbage collected.
Claims23
A method for managing memory, comprising:
- determining which, if any, objects included in a set of objects associated with a first thread included in a plurality of threads associated with a heap are no longer reachable;
- garbage collecting any objects of the set that are not determined to be reachable;
- keeping track of which objects stored in the heap are included in the set of objects associated with the first thread;
- and
- removing an object from the set of objects associated with the first thread if the object becomes associated with a thread other than the first thread.
A computer system, comprising:
- a memory comprising a heap with which a plurality of processing threads are associated;
- and
- a processor coupled to the memory and configured to:
- determine which, if any, objects included in a set of objects associated with a first thread included in a plurality of threads associated with the heap are no longer reachable;
- garbage collect any objects of the set that are not determined to be reachable;
- keep track of which objects stored in the heap are included in the set of objects associated with the first thread;
- and
- remove an object from the set of objects associated with the first thread if the object becomes associated with a thread other than the first thread.
A computer program product for managing memory, the computer program product being embodied in a computer readable storage medium and comprising computer instructions for:
- determining which, if any, objects included in a set of objects associated with a first thread included in a plurality of threads associated with a heap are no longer reachable;
- garbage collecting any objects of the set that are not determined to be reachable;
- keeping track of which objects stored in the heap are included in the set of objects associated with the first thread;
- and
- removing an object from the set of objects associated with the first thread if the object becomes associated with a thread other than the first thread.
Dependencies are inferred from the claim text.