]>
Commit | Line | Data |
---|---|---|
067568db MK |
1 | .\" Copyright (c) 2012 by Michael Kerrisk <mtk.manpages@gmail.com> |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
067568db | 4 | .\" |
4c1c5274 | 5 | .TH malloc_stats 3 (date) "Linux man-pages (unreleased)" |
067568db MK |
6 | .SH NAME |
7 | malloc_stats \- print memory allocation statistics | |
cf79e286 AC |
8 | .SH LIBRARY |
9 | Standard C library | |
8fc3b2cf | 10 | .RI ( libc ", " \-lc ) |
067568db | 11 | .SH SYNOPSIS |
c7db92b9 | 12 | .nf |
067568db | 13 | .B #include <malloc.h> |
dbfe9c70 | 14 | .PP |
067568db | 15 | .B void malloc_stats(void); |
c7db92b9 | 16 | .fi |
067568db MK |
17 | .SH DESCRIPTION |
18 | The | |
19 | .BR malloc_stats () | |
20 | function prints (on standard error) statistics about memory allocated by | |
21 | .BR malloc (3) | |
22 | and related functions. | |
23 | For each arena (allocation area), this function prints | |
1da7358e | 24 | the total amount of memory allocated |
067568db MK |
25 | and the total number of bytes consumed by in-use allocations. |
26 | (These two values correspond to the | |
27 | .I arena | |
28 | and | |
29 | .I uordblks | |
30 | fields retrieved by | |
31 | .BR mallinfo (3).) | |
32 | In addition, | |
33 | the function prints the sum of these two statistics for all arenas, | |
34 | and the maximum number of blocks and bytes that were ever simultaneously | |
35 | allocated using | |
36 | .BR mmap (2). | |
37 | .\" .SH VERSIONS | |
38 | .\" Available already in glibc 2.0, possibly earlier | |
72dd4c2f ZL |
39 | .SH ATTRIBUTES |
40 | For an explanation of the terms used in this section, see | |
41 | .BR attributes (7). | |
c466875e MK |
42 | .ad l |
43 | .nh | |
72dd4c2f ZL |
44 | .TS |
45 | allbox; | |
c466875e | 46 | lbx lb lb |
72dd4c2f ZL |
47 | l l l. |
48 | Interface Attribute Value | |
49 | T{ | |
50 | .BR malloc_stats () | |
51 | T} Thread safety MT-Safe | |
52 | .TE | |
c466875e MK |
53 | .hy |
54 | .ad | |
847e0d88 | 55 | .sp 1 |
3113c7f3 | 56 | .SH STANDARDS |
067568db MK |
57 | This function is a GNU extension. |
58 | .SH NOTES | |
59 | More detailed information about memory allocations in the main arena | |
60 | can be obtained using | |
61 | .BR mallinfo (3). | |
62 | .SH SEE ALSO | |
63 | .BR mmap (2), | |
64 | .BR mallinfo (3), | |
65 | .BR malloc (3), | |
66 | .BR malloc_info (3), | |
67 | .BR mallopt (3) |