Memory Management Flashcards
What 2 methods are used in ArrayList class?
add() and remove()
A class defined to represent each list item is known as a…
list node
True or false.
Can a node be inserted between 2 other nodes?
True
What are the 4 memory regions that a program uses?
Code, Static Memory, The Stack, and The heap
What is the region code?
The region where the program instructions are stored
What is the region Static memory?
The region where static fields are allocated
Does static variables change? Do their addresses change too?
Static variables do not change and their address do not change either.
What is the Stack Region?
The region where a methods local variables are allocated during a method call.
What can a stack region also be called?
It can also be called a automatic memor.
What does a method call do?
It adds local variables to the stack and return removes them from the stack.
What is the region The heap.
The region where the “new” operator allocates memory for objects.
The heap can also be referred to as…
Free Store
What is garbage collection?
Wherein a programs automatic behavior that finds certain areas unreachables i.e(unused)
What is a reference count?
Java virtual machine keeps a count of all reference variables that are currently referring to an object
What makes an object unreachable?
If there is no reference count than the object is unreachable.