reachability
Whether an object can still be reached by following references from roots such as global variables and the current call stack.
In more detail
Reachable objects are kept; unreachable ones are garbage. A detached DOM node held in a global array is still reachable, so it is never freed.
Related terms
- garbage collection — The automatic freeing of memory held by objects that the program can no longer reach.
- mark-and-sweep — The garbage collection method that marks every object reachable from the roots, then sweeps away everything unmarked.
- strong reference — A normal reference that keeps the object it points to alive; a weak reference does not stop garbage collection.
Taught in
- Memory Management: Garbage Collection, Memory Leaks And WeakMap — Frontend Architecture & Web Platform