Call Stack (Heap) Flashcards

1
Q

What is the process

A

The instance of a program being executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two types of memory allocation

A

Static and dynamic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does each process contain

A

Call stack (where local variables, parameters and return address are stored)
Heap (where strings, list and arrays are stored)
Global variables
Program code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 2 purposes of the call stack

A

Keep track of which code the program needs to return to
Keep track of the parameters and local variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the call stack made of

A

Local variables
Parameters
Return address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the heap

A

A pool of unallocated memory used to store data for objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does the heap work

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly