Memory Management Fundamentals

Memory management is the process of controlling and coordinating the way a software application access computer memory.

When a software runs on a target Operating system on a computer it needs access to the computers RAM(Random-access memory) to:

When a software program uses memory there are two regions of memory they use, apart from the space used to load the bytecode, Stack and Heap memory.

The stack is used for static memory allocation:

Heap is used for dynamic memory allocation and unlike stack, the program needs to look up the data in heap using pointers: