Call Stack (Heap) Flashcards
What is the process
The instance of a program being executed
What are the two types of memory allocation
Static and dynamic
What does each process contain
Call stack (where local variables, parameters and return address are stored)
Heap (where strings, list and arrays are stored)
Global variables
Program code
What are the 2 purposes of the call stack
Keep track of which code the program needs to return to
Keep track of the parameters and local variables
What is the call stack made of
Local variables
Parameters
Return address
What is the heap
A pool of unallocated memory used to store data for objects
How does the heap work
When a new object is created the heap grows in size. When all references to the object is gone memory is freed meaning the heap shrinks