Debian Codegraph @

upstream/debian-trixie/man3/malloc_stats.3

raw
1 '\" t
2 .\" Copyright (c) 2012 by Michael Kerrisk <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH malloc_stats 3 2024-05-02 "Linux man-pages 6.9.1"
7 .SH NAME
8 malloc_stats \- print memory allocation statistics
9 .SH LIBRARY
10 Standard C library
11 .RI ( libc ", " \-lc )
12 .SH SYNOPSIS
13 .nf
14 .B #include <malloc.h>
15 .P
16 .B void malloc_stats(void);
17 .fi
18 .SH DESCRIPTION
19 The
20 .BR malloc_stats ()
21 function prints (on standard error) statistics about memory allocated by
22 .BR malloc (3)
23 and related functions.
24 For each arena (allocation area), this function prints
25 the total amount of memory allocated
26 and the total number of bytes consumed by in-use allocations.
27 (These two values correspond to the
28 .I arena
29 and
30 .I uordblks
31 fields retrieved by
32 .BR mallinfo (3).)
33 In addition,
34 the function prints the sum of these two statistics for all arenas,
35 and the maximum number of blocks and bytes that were ever simultaneously
36 allocated using
37 .BR mmap (2).
38 .SH ATTRIBUTES
39 For an explanation of the terms used in this section, see
40 .BR attributes (7).
41 .TS
42 allbox;
43 lbx lb lb
44 l l l.
45 Interface Attribute Value
46 T{
47 .na
48 .nh
49 .BR malloc_stats ()
50 T} Thread safety MT-Safe
51 .TE
52 .SH STANDARDS
53 GNU.
54 .SH HISTORY
55 glibc 2.0.
56 .SH NOTES
57 More detailed information about memory allocations in the main arena
58 can be obtained using
59 .BR mallinfo (3).
60 .SH SEE ALSO
61 .BR mmap (2),
62 .BR mallinfo (3),
63 .BR malloc (3),
64 .BR malloc_info (3),
65 .BR mallopt (3)