Processes

The memory chunk that a process controls contains several sections:

Note that the stack and the heap start at opposite ends of the process's free space and grow towards each other since the size of the stack or heap could change over the process's execution. If they should ever meet, then either a stack overflow error will occur, or else a call to new or malloc (the function the language C uses to allocate memory) will fail due to insufficient memory available.