Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

malloc_stats(3) [linux man page]

MALLOC_STATS(3) 					     Linux Programmer's Manual						   MALLOC_STATS(3)

NAME
malloc_stats - print memory allocation statistics SYNOPSIS
#include <malloc.h> void malloc_stats(void); DESCRIPTION
The malloc_stats() function prints (on standard error) statistics about memory allocated by malloc(3) and related functions. For each arena (allocation area), this function prints the total amount of memory allocated and the total number of bytes consumed by in-use alloca- tions. (These two values correspond to the arena and uordblks fields retrieved by mallinfo(3).) In addition, the function prints the sum of these two statistics for all arenas, and the maximum number of blocks and bytes that were ever simultaneously allocated using mmap(2). CONFORMING TO
This function is a GNU extension. NOTES
More detailed information about memory allocations in the main arena can be obtained using mallinfo(3). SEE ALSO
mmap(2), mallinfo(3), malloc(3), malloc_info(3), mallopt(3) Linux 2012-05-06 MALLOC_STATS(3)

Check Out this Related Man Page

MALLOC_STATS(3) 					     Linux Programmer's Manual						   MALLOC_STATS(3)

NAME
malloc_stats - print memory allocation statistics SYNOPSIS
#include <malloc.h> void malloc_stats(void); DESCRIPTION
The malloc_stats() function prints (on standard error) statistics about memory allocated by malloc(3) and related functions. For each arena (allocation area), this function prints the total amount of memory allocated and the total number of bytes consumed by in-use alloca- tions. (These two values correspond to the arena and uordblks fields retrieved by mallinfo(3).) In addition, the function prints the sum of these two statistics for all arenas, and the maximum number of blocks and bytes that were ever simultaneously allocated using mmap(2). ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +---------------+---------------+---------+ |Interface | Attribute | Value | +---------------+---------------+---------+ |malloc_stats() | Thread safety | MT-Safe | +---------------+---------------+---------+ CONFORMING TO
This function is a GNU extension. NOTES
More detailed information about memory allocations in the main arena can be obtained using mallinfo(3). SEE ALSO
mmap(2), mallinfo(3), malloc(3), malloc_info(3), mallopt(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2017-09-15 MALLOC_STATS(3)
Man Page

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

the amount of memory consumed per user

Hi, under UNIX AIX how determine the amount of memory consumed per user ? Many thanks before. (1 Reply)
Discussion started by: big123456
1 Replies

2. Programming

malloc gives the same memory to two different nodes. How to deal with it?

When allocating memory for two different nodes, the resulting memory are the same. Clearly, this will lead to a mistake. This happened in a function. And the process must be in a function. (gdb) p tree->list $43 = (node *) 0x8be4180 (gdb) p tree->list $44 = (node *) 0x8be4180 At the... (2 Replies)
Discussion started by: cdbug
2 Replies

3. Shell Programming and Scripting

User perl to get memory installed in a machine

I currently have a statistics gathering script i run on my Linux servers. One of the stat i gather is total memory in the machine. The script is all perl with the exception of gathering the memory for that i use the following command: $ram = (`cat /proc/meminfo | grep "MemTotal" | awk... (1 Reply)
Discussion started by: insania
1 Replies

4. Programming

Stress testing memory using malloc in linux ??

Hi to all, Recently i am testing an equipment that runs in i586 fedora linux. I have to test mmap function. For that i determined to fill the memory and run the required application to check whether it throws any mmap error regarding low resources. This is the line that does the allocation. ... (3 Replies)
Discussion started by: frozensmilz
3 Replies

5. Programming

Regarding the maximum memory allocated by malloc() function on HP-UX B11.11

In a 'C' program,when I am trying to allocate memory with the help of malloc () function, it is allocating the memory up to a certain limit for e.g. in my case, it is 670 MB (approx). malloc() returns NULL if I allocate more than this amount of memory.When I tried to allocate memory in chunks of... (1 Reply)
Discussion started by: vipinsachan
1 Replies

6. BSD

Mmap source

I'm new to kernels and C, and I am tinkering around trying to understand OpenBSD's secure memory management. I'm stumped on a couple points. I've read up on malloc() which was apparently modified years ago to allocate memory using mmap. First question, that would be this here, right? ... (4 Replies)
Discussion started by: dcicc
4 Replies

7. AIX

Process, PID and total memory consumed on AIX.

Hi, Below is the code snippet I use on Linux (Centos) to retrieve the Process Name, PID and memory consumed on Linux (Centos) host:- top -b -n 1 | awk -v date="$tdydate" -v ip="$ip" 'NR>7 {print date","ip","$12,","$1,","$10}' Any idea how the same can be retrieved on an AIX host? This... (1 Reply)
Discussion started by: Vipin Batra
1 Replies