Memory Allocation Metrics

Memory allocation metrics are calculated from heap tracing data recorded by the Collector. In heap tracing, calls to the C standard library memory allocation functions malloc, realloc, and memalign and the deallocation routine free are intercepted by the Collector, and data for the call is recorded in an experiment. The Analyzer matches the calls to the allocation functions with the calls to free that deallocate the memory and calculates the metrics listed in the table below. A call to realloc is interpreted as a call to free followed by a call to malloc.

For applications written in the JavaTM programming language, heap tracing data records object allocation events, generated by the user code, and object deallocation events, generated by the garbage collector. In addition, any use of malloc, free, etc. also generates events that are recorded. Those events may come from native code, or from the JavaTM Virtual Machine (JVM) software itself. The data collection process uses JavaTM Virtual Machine Profiler Interface (JVMPI) events describing memory allocation and garbage collection, which can cause significant dilation in runtime. Most Java technology-based applications have a great many of these events, which leads to large experiments, and scalability problems processing the data. Furthermore, if these events are requested, the garbage collector disables some inlined allocations, costing additional CPU time for the longer allocation path.

Note: the terms "Java Virtual Machine" or "JVM" mean a virtual machine for the Java platform.

Metric Definition
Allocations The number of calls to the memory allocation functions.
Bytes allocated The sum of the number of bytes allocated in each call to the memory allocation functions.
Leaks The number of calls to the memory allocation functions that did not have a corresponding call to free.
Bytes leaked The number of bytes that were allocated but not freed.

If you use filtering to select data by thread, LWP, or sample, the allocation calls in the selected data are matched with the corresponding calls to free, regardless of whether the calls to free are in the selected data or not.

Because the Collector interposes its own functions on the C standard library functions, the metrics are attributed to the versions of the functions from the Collector library, libcollector.so.

A list of leaks and allocations is presented in the LeakList tab.

See also
The LeakList Tab
Timing Metrics
Hardware Counter Metrics
Thread Synchronization Delay Metrics
MPI Tracing Metrics
Exclusive, Inclusive, and Attributed Metrics
Setting Data Presentation Preferences

Can't find what you are looking for? Submit your comments at http://www.sun.com/hwdocs/feedback.
Legal Notices