OSDN Git Service

96cf20eacf0ae74a43f32ea341ae618836100404
[linuxjm/LDP_man-pages.git] / original / 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  2012-05-06 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 malloc_stats \- print memory allocation statistics
29 .SH SYNOPSIS
30 .B #include <malloc.h>
31
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 CONFORMING TO
56 This function is a GNU extension.
57 .SH NOTES
58 More detailed information about memory allocations in the main arena
59 can be obtained using
60 .BR mallinfo (3).
61 .SH SEE ALSO
62 .BR mmap (2),
63 .BR mallinfo (3),
64 .BR malloc (3),
65 .BR malloc_info (3),
66 .BR mallopt (3)
67 .SH COLOPHON
68 This page is part of release 3.67 of the Linux
69 .I man-pages
70 project.
71 A description of the project,
72 information about reporting bugs,
73 and the latest version of this page,
74 can be found at
75 \%http://www.kernel.org/doc/man\-pages/.