Java Cleaner API: Replace finalize() with Cleaner
Learn the Java Cleaner API with a native memory example, the mistakes that stop cleanup, and how to migrate deprecated finalize() code in Java 25.
Learn the Java Cleaner API with a native memory example, the mistakes that stop cleanup, and how to migrate deprecated finalize() code in Java 25.
Java -XX:SoftMaxHeapSize sets a soft heap limit below -Xmx. Which GCs honour it, the jcmd byte-value trap, MXBean code and a container example.
The Java memory model on JDK 25 explained with heap generations, thread stacks, metaspace and code cache, plus their flags, defaults and errors.
Java garbage collection algorithms explained for JDK 25 with mark-sweep, compact and copy, plus G1, ZGC, Shenandoah, Serial, Parallel, flags and GC logs.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.