Method and system for managing a heap. A map is employed to indicate which
areas of the heap are inaccessible to a program. Such areas constitute
garbage which is potentially returnable to a data structure which
identifies free storage available for reallocation to the program. By
choosing map entries corresponding to portions of storage whose size is
of the same order of magnitude as a predetermined minimum unit size for
the data structure, a small map can be used. Such a map can be scanned
more quickly than a larger map of higher granularity to identify only
relatively larger areas of garbage for reallocation.