Memory Management Flashcards

1
Q

What keyword is responsible for allocating memory for new objects?

A

new

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

Generally speaking, when does the garbage collector deallocate memory?

A

Whenever an object is no longer reachable

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

When is a frame created?

A

Each time a method is called

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

What is stored in the stack?

A

Primitive types and the memory address for reference types

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

When is the heap created?

A

Whenever an application starts. There is only 1 heap per application

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

What is stored in the heap?

A

The actual objects of an application (not their memory address like in stacks)

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