These probes are designed to signal relatively unusual situations within the virtual memory subsystem of the GNU C Library.
This probe is triggered after the main arena is extended by calling
sbrk
. Argument $arg1 is the additional size requested tosbrk
, and $arg2 is the pointer that marks the end of thesbrk
area, returned in response to the request.
This probe is triggered after the size of the main arena is decreased by calling
sbrk
. Argument $arg1 is the size released bysbrk
(the positive value, rather than the negative value passed tosbrk
), and $arg2 is the pointer that marks the end of thesbrk
area, returned in response to the request.
This probe is triggered after a new heap is
mmap
ed. Argument $arg1 is a pointer to the base of the memory area, where theheap_info
data structure is held, and $arg2 is the size of the heap.
This probe is triggered before (unlike the other sbrk and heap probes) a heap is completely removed via
munmap
. Argument $arg1 is a pointer to the heap, and $arg2 is the size of the heap.
This probe is triggered after a trailing portion of an
mmap
ed heap is extended. Argument $arg1 is a pointer to the heap, and $arg2 is the new size of the heap.
This probe is triggered after a trailing portion of an
mmap
ed heap is released. Argument $arg1 is a pointer to the heap, and $arg2 is the new size of the heap.
These probes are triggered when the corresponding functions fail to obtain the requested amount of memory from the arena in use, before they call
arena_get_retry
to select an alternate arena in which to retry the allocation. Argument $arg1 is the amount of memory requested by the user; in thecalloc
case, that is the total size computed from both function arguments. In therealloc
case, $arg2 is the pointer to the memory area being resized. In thememalign
case, $arg2 is the alignment to be used for the request, which may be stricter than the value passed to thememalign
function. Amemalign
probe is also used by functionsposix_memalign, valloc
andpvalloc
.Note that the argument order does not match that of the corresponding two-argument functions, so that in all of these probes the user-requested allocation size is in $arg1.
This probe is triggered within
arena_get_retry
(the function called to select the alternate arena in which to retry an allocation that failed on the first attempt), before the selection of an alternate arena. This probe is redundant, but much easier to use when it's not important to determine which of the various memory allocation functions is failing to allocate on the first try. Argument $arg1 is the same as in the function-specific probes, except for extra room for padding introduced by functions that have to ensure stricter alignment. Argument $arg2 is the arena in which allocation failed.
This probe is triggered when
malloc
allocates and initializes an additional arena (not the main arena), but before the arena is assigned to the running thread or inserted into the internal linked list of arenas. The arena'smalloc_state
internal data structure is located at $arg1, within a newly-allocated heap big enough to hold at least $arg2 bytes.
This probe is triggered when
malloc
has just selected an existing arena to reuse, and (temporarily) reserved it for exclusive use. Argument $arg1 is a pointer to the newly-selected arena, and $arg2 is a pointer to the arena previously used by that thread.This occurs within
reused_arena
, right after the mutex mentioned in probememory_arena_reuse_wait
is acquired; argument $arg1 will point to the same arena. In this configuration, this will usually only occur once per thread. The exception is when a thread first selected the main arena, but a subsequent allocation from it fails: then, and only then, may we switch to another arena to retry that allocations, and for further allocations within that thread.
This probe is triggered when
malloc
is about to wait for an arena to become available for reuse. Argument $arg1 holds a pointer to the mutex the thread is going to wait on, $arg2 is a pointer to a newly-chosen arena to be reused, and $arg3 is a pointer to the arena previously used by that thread.This occurs within
reused_arena
, when a thread first tries to allocate memory or needs a retry after a failure to allocate from the main arena, there isn't any free arena, the maximum number of arenas has been reached, and an existing arena was chosen for reuse, but its mutex could not be immediately acquired. The mutex in $arg1 is the mutex of the selected arena.
This probe is triggered when
malloc
has chosen an arena that is in the free list for use by a thread, within theget_free_list
function. The argument $arg1 holds a pointer to the selected arena.
This probe is triggered when function
mallopt
is called to changemalloc
internal configuration parameters, before any change to the parameters is made. The arguments $arg1 and $arg2 are the ones passed to themallopt
function.
This probe is triggered shortly after the
memory_mallopt
probe, when the parameter to be changed isM_MXFAST
, and the requested value is in an acceptable range. Argument $arg1 is the requested value, and $arg2 is the previous value of thismalloc
parameter.
This probe is triggere shortly after the
memory_mallopt
probe, when the parameter to be changed isM_TRIM_THRESHOLD
. Argument $arg1 is the requested value, $arg2 is the previous value of thismalloc
parameter, and $arg3 is nonzero if dynamic threshold adjustment was already disabled.
This probe is triggered shortly after the
memory_mallopt
probe, when the parameter to be changed isM_TOP_PAD
. Argument $arg1 is the requested value, $arg2 is the previous value of thismalloc
parameter, and $arg3 is nonzero if dynamic threshold adjustment was already disabled.
This probe is triggered shortly after the
memory_mallopt
probe, when the parameter to be changed isM_MMAP_THRESHOLD
, and the requested value is in an acceptable range. Argument $arg1 is the requested value, $arg2 is the previous value of thismalloc
parameter, and $arg3 is nonzero if dynamic threshold adjustment was already disabled.
This probe is triggered shortly after the
memory_mallopt
probe, when the parameter to be changed isM_MMAP_MAX
. Argument $arg1 is the requested value, $arg2 is the previous value of thismalloc
parameter, and $arg3 is nonzero if dynamic threshold adjustment was already disabled.
This probe is triggered shortly after the
memory_mallopt
probe, when the parameter to be changed isM_CHECK_ACTION
. Argument $arg1 is the requested value, and $arg2 is the previous value of thismalloc
parameter.
This probe is triggered shortly after the
memory_mallopt
probe, when the parameter to be changed isM_PERTURB
. Argument $arg1 is the requested value, and $arg2 is the previous value of thismalloc
parameter.
This probe is triggered shortly after the
memory_mallopt
probe, when the parameter to be changed isM_ARENA_TEST
, and the requested value is in an acceptable range. Argument $arg1 is the requested value, and $arg2 is the previous value of thismalloc
parameter.
This probe is triggered shortly after the
memory_mallopt
probe, when the parameter to be changed isM_ARENA_MAX
, and the requested value is in an acceptable range. Argument $arg1 is the requested value, and $arg2 is the previous value of thismalloc
parameter.