Malloc trace
Malloc Trace provides an optional extension to the malloc subsystem for use with the trace facility.
Traces of the malloc, realloc, and free subroutines are recorded for use in problem determination and performance analysis.
Malloc Trace is not enabled by default, but can be enabled and configured prior to process startup through the MALLOCDEBUG environment variable.
Events recorded by malloc trace
- HKWD_LIBC_MALL_SUBSYSTEM
- HKWD_LIBC_MALL_INTERNAL
When tracing is enabled for HKWD_LIBC_MALL_SUBSYSTEM, the input parameters, as well as return values for each call to malloc, realloc, and free subroutines are recorded in the trace subsystem.
When tracing is enabled for HKWD_LIBC_MALL_INTERNAL and the Malloc Detect debugging tools are enabled, Malloc Trace will log a trace event whenever Malloc Detect detects an error in the internal data structures of the malloc subsystem.
Enabling malloc trace
MALLOCDEBUG=trace
MALLOCDEBUG=[trace, other_option]
Limitations