Java / JDK, JRE, JVM, JIT
How Garbage collection works in Java?
Every Java object tree must have one or more root objects. As long as the application can reach those roots, the whole tree is reachable.
There are some objects which are considered ?important? by GC. These are called GC roots and are (almost) never discarded. They are, for example, currently executing method's local variables and input parameters, application threads, references from native code and similar ?global? objects. Any object referenced from those GC roots are assumed to be in use and not discarded.
More Related questions...