From this IBM article on handling memory leaks in Java :
The garbage collector starts at the root nodes, classes that persist
throughout the life of a Java application, and sweeps through all of
the nodes that are referenced. As it traverses the nodes, it keeps
track of which objects are actively being referenced. Any classes that
are no longer being referenced are then eligible to be garbage
collected. The memory resources used by these objects can be returned
to the Java virtual machine (JVM) when the objects are deleted.
What are the classes that persist through out the life of a Java application ?
What you are asking is also called Garbage Collection Roots. From Yourkit’s documentation of GC roots:
You can also read it from The Truth About Garbage Collection (dated).