Memory Management (day 3) Flashcards
1
Q
Stack and heap
A
All locals variables and method invocations stored in stack
All objects along with instance variables stored in heap
2
Q
Memory leak
A
Resource is not deallocated; stuff we can’t manage
3
Q
Garbage collecter
A
Automatically deallocates memory used from reasourses. Prevents memory leak
4
Q
Eligibility of garbage collection
A
If there’s a break between a stack and it’s heap. The heap can be collected