On the Unix system, and later in the C standard library there are functions to handle variable amounts of memory in a dynamic way. This allows programs to dynamically request memory blocks from the system. The operating system
only provides a very rough system call ‘brk’ to change the size of a big memory chunk, which is known as the heap.
(Read more …)
On top of this system call the malloc interface is located, which provides a layer between the application and the system call. It can dynamically split the large single block into smaller chunks, free those chunks on request of the application and avoid fragmentation while doing so. You can compare the malloc interface to a linear file system on a large, but
dynamically sized raw device…
Read This paper in Phrack Magazine
Source : Phrack.org