A method and apparatus for profiling a heap. According to the method, a
flexible and comprehensive general-purpose profiling interface that
uniformly accommodates a wide variety of memory allocation and garbage
collection methods is used. The profiling interface, among other things,
employs a set of virtual machine profiling interface events that support
all known types of garbage collection methods.