Garbage Collection

If you want an introduction to garbage collection, then have a look at Understanding Garbage Collectors and Understanding the JDK’s New Superfast Garbage Collectors which should help.

From the early days of Java the issue of Garbage Collection has been a challenging subject, especially when linked to performance. In JDK 11 a new Garbage Collector was introduced Epsilon: The JDK’s Do-Nothing Garbage Collector which allocates memory but does not release it. Hence Epsilon is good for testing and seeing what impact garbage collection is having, assuming you have enough memory to do this.

Following the release of JDK 18 there is a good overview of the OpenJDK Garbage Collectors at Java garbage collection: The 10-release evolution from JDK 8 to JDK 18 which is a helpful read.