Free item distribution among multiple free lists during garbage collection for more efficient object allocation
AssigneeInternational Business Machines Corporation
InventorGeoffrey Owen Blandy
Life of this patent
Estimating the term…
Abstract
A garbage collector predicts future allocation requirements and then distributes free items to multiple subpool free lists and a TLH free list during the sweep phase according to the future allocation requirements. The sizes of subpools and number of free items in subpools are predicted as the most likely to match future allocation requests. Once a subpool free list is filled with the number of free items needed according to the future allocation requirements, any additional free items designated for the subpool free list can be divided into multiple TLH sized free items and placed on the TLH free list. Allocation threads are enabled to acquire free items from the TLH free list and to replenish a current TLH without acquiring heap lock.
Claims8
A system for efficient thread-local heap replenishment, comprising:
- a heap manager for managing a heap comprising a plurality of thread-local heaps, a thread-local heap free list accessible to said plurality of thread-local heaps for replenishment without requiring a heap lock for exclusively locking said heap, and a plurality of subpool free lists accessible to said plurality of thread-local heaps for replenishment with said heap lock;
- means, responsive to a thread from among a plurality of threads accessing said heap receiving a thread-local heap allocation request wherein a current thread-local heap from among said plurality of thread-local heaps is unable to meet said allocation request and said allocation request is less than a maximum thread-local heap free size, for acquiring a share of a shared lock that postpones garbage collection within said heap without exclusively locking said heap;
- and
- means, responsive to locating a free item within said thread-local heap free list, for replenishing said current thread-local heap with said free item, such that said current thread-local heap is efficiently replenished without requiring the acquisition of said heap lock.
A computer program product, residing on a computer readable volatile or non-volatile storage medium, for efficient thread-local heap replenishment, said computer program product comprising:
- means for managing a heap comprising a plurality of thread-local heaps, a thread-local heap free list accessible to said plurality of thread-local heaps for replenishment without requiring a heap lock for exclusively locking said heap, and a plurality of subpool free lists accessible to said plurality of thread-local heaps for replenishment with said heap lock;
- means, responsive to a thread from among a plurality of threads accessing said heap receiving a thread-local heap allocation request wherein a current thread-local heap from among said plurality of thread-local heaps is unable to meet said allocation request and said allocation request is less than a maximum thread-local heap free size, for acquiring a share of a shared lock that postpones garbage collection within said heap without exclusively locking said heap;
- and
- means, responsive to locating a free item within said thread-local heap free list, for replenishing said current thread-local heap with said free item, such that said current thread-local heap is efficiently replenished without requiring the acquisition of said heap lock.
Dependencies are inferred from the claim text.