A method, system, and program for improving free item distribution among
multiple free lists during garbage collection for more efficient object
allocation are provided. 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. In particular, 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.