Next: Algorithm-Independent Allocation and Garbage
Up: Heap Profiling
Previous: Heap Profiling
Excessive heap allocation leads to performance degradation for two
reasons: the cost of the allocation operations themselves, and because
the heap is filled up more quickly, the cost of more frequent garbage
collections. With the JVMPI, the profiler follows the following steps
to pinpoint the part of the program that performs excessive heap
allocation:
-
Enable the event notification for object allocation, so that the
virtual machine issues a function call to the profiler agent when the
current thread performs heap allocation.
-
Obtain the current stack trace from the virtual machine when object
allocation event arrives. The stack trace serves as a good
identification of the heap allocation site. The programmer should
concentrate on optimizing busy heap allocation sites.
-
Enable the event notification for object reclamation, so that
the profiler can keep track of how many objects allocated from a
given site are being kept live.
Sheng Liang
1998-12-19