Go to the first, previous, next, last section, table of contents.


Statistics for Storage Allocation with malloc

You can get information about dynamic storage allocation by calling the mallinfo function. This function and its associated data type are declared in `malloc.h'; they are an extension of the standard SVID/XPG version.

Data Type: struct mallinfo
This structure type is used to return information about the dynamic storage allocator. It contains the following members:

int arena
This is the total size of memory allocated with sbrk by malloc, in bytes.
int ordblks
This is the number of chunks not in use. (The storage allocator internally gets chunks of memory from the operating system, and then carves them up to satisfy individual malloc requests; see section Efficiency Considerations for malloc.)
int smblks
This field is unused.
int hblks
This is the total number of chunks allocated with mmap.
int hblkhd
This is the total size of memory allocated with mmap, in bytes.
int usmblks
This field is unused.
int fsmblks
This field is unused.
int uordblks
This is the total size of memory occupied by chunks handed out by malloc.
int fordblks
This is the total size of memory occupied by free (not in use) chunks.
int keepcost
This is the size of the top-most, releaseable chunk that normally borders the end of the heap (i.e. the "brk" of the process).

Function: struct mallinfo mallinfo (void)
This function returns information about the current dynamic memory usage in a structure of type struct mallinfo.


Go to the first, previous, next, last section, table of contents.