One embodiment of the present invention provides a system that facilitates
keeping track of memory usage of tasks in a shared heap without
performing a full garbage-collection operation. The system operates by
determining a memory usage by each task in a young generation of the
shared heap. Once the memory usage for each task has been determined, the
system then adds the memory usage for each task in the young generation
of the shared heap to a global memory usage for each task (obtained
during a preceding full garbage-collection operation) to produce an
actual memory usage for each task.