Stack and Heap Flashcards

1
Q

Heap Memory is used by ____.

A

all the parts of the application

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

Stack memory is used by _____.

A

only one thread of exectution

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

Whenever an object is created, ____

A

its always stored in the Heap Space and the stack memory contains the reference to it.

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

Stack Memory only contains ___

A

local primitive values and reference variables to objects in Heap Space

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

Objects stored in the _______ are globally accessible

A

Heap

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

______ can’t be accessed by other threads

A

Stack Memory

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

Memory management in Stack is done in ______

A

LIFO

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

Heap memory management:

A

more complex due to global accessibility

Memory divided into young gen, old gen, etc.

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

_____ memory is short-lived

A

Stack

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

_____ memory lives from start until end of application exectution

A

Heap

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

When stack is full, java runtime throws:

A

java.lang.StackOverFlowError

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

When Heap is full, java runtime throws:

A

java.lang.OutOfMemoryError

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

_____ memory size is smaller compared to ____ memory

A

Stack, Heap

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

_____ memory speed is faster compared to ____ memory

A

Stack, Heap

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