Main Page | See live article | Alphabetical index

Memory manager

A memory manager is a part of a computer program which accepts requests from the program to allocate and deallocate chunks of memory.

The objectives of the memory manager is generally to allow dynamic memory allocation. For example, in the C programming language, without use of the memory allocation library, memory can only be allocated statically, and on the stack, whilst the use of a memory manager allows for dynamic allocation on the heap. The memory manager can also make the processes of allocation and deallocation quicker, to group allocated blocks on specific conditions, and even to collect statistics, and trace memory access violations.

The interface of the memory manager is a set of functions which are supposed to be used in the program for memory allocations and dealocations. In C, the memory manager is accessed through, primarily, malloc and free (with supporting realloc, calloc, etc., functions that are simple constructs depending on malloc), and in C++ there are 12 global functions: new, new[], delete, delete[], new(nothrow), new(nothrow)[], delete(nothrow), delete(nothrow)[], malloc, calloc, realloc, and free.