previous | start | next

Heap Size

The kernel keeps track of a break address that is the end of the heap segment for each process. (in a variable named brk).

There are system calls to increase heap segment, which increase the break address.

    #include <unistd.h>

    int brk(void *end_data_segment); // sets the "brk" value 

    void *sbrk(intptr_t increment);  // adds increment to "brk" value



previous | start | next