A computer system provides an object-based environment. The computer system includes
storage. A contiguous linear portion of the storage is logically divided into first
and second heaps located at opposite ends of the linear portion of storage. Any
gap between the two heaps represents an unallocated region of storage. The system
permits references from objects on the first heap to objects on the second heap
and vice versa. A garbage collector operates across both heaps to remove objects
that are no longer live. Means are provided for expanding the first and second
heaps into the unallocated region. The first heap is expanded according to a first
expansion policy, and the second heap is expanded according to a second expansion policy.