]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/malloc_stats.3
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[thirdparty/man-pages.git] / man3 / malloc_stats.3
1 '\" t
2 .\" Copyright (c) 2012 by Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .TH MALLOC_STATS 3 2017-09-15 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 malloc_stats \- print memory allocation statistics
29 .SH SYNOPSIS
30 .B #include <malloc.h>
31 .PP
32 .B void malloc_stats(void);
33 .SH DESCRIPTION
34 The
35 .BR malloc_stats ()
36 function prints (on standard error) statistics about memory allocated by
37 .BR malloc (3)
38 and related functions.
39 For each arena (allocation area), this function prints
40 the total amount of memory allocated
41 and the total number of bytes consumed by in-use allocations.
42 (These two values correspond to the
43 .I arena
44 and
45 .I uordblks
46 fields retrieved by
47 .BR mallinfo (3).)
48 In addition,
49 the function prints the sum of these two statistics for all arenas,
50 and the maximum number of blocks and bytes that were ever simultaneously
51 allocated using
52 .BR mmap (2).
53 .\" .SH VERSIONS
54 .\" Available already in glibc 2.0, possibly earlier
55 .SH ATTRIBUTES
56 For an explanation of the terms used in this section, see
57 .BR attributes (7).
58 .TS
59 allbox;
60 lb lb lb
61 l l l.
62 Interface Attribute Value
63 T{
64 .BR malloc_stats ()
65 T} Thread safety MT-Safe
66 .TE
67 .sp 1
68 .SH CONFORMING TO
69 This function is a GNU extension.
70 .SH NOTES
71 More detailed information about memory allocations in the main arena
72 can be obtained using
73 .BR mallinfo (3).
74 .SH SEE ALSO
75 .BR mmap (2),
76 .BR mallinfo (3),
77 .BR malloc (3),
78 .BR malloc_info (3),
79 .BR mallopt (3)