Disclosed are a partial heap garbage collector, and a partial heap garbage
collection method, that during collection checks the time remaining (or
equivalently the time taken so far, or the work done so far) to complete
the partial heap collection. In a preferred embodiment, the partial heap
collection is guaranteed to complete within a fixed time interval. For
example, this guarantee may be obtained by applying a worst-case
execution time (WCET) and sizing a nursery so that complete evacuation of
the nursery can always be achieved on time. As an alternative, a
technique, referred to as syncopation, may be used to allow generational
collection to be used despite variance in program behavior over the short
time scales in which a nursery can be collected. Syncopation may be
accomplished via allocation control or via collection control.