JVM 21 introduces G1GC Generational, it can reduce heap and cpu consumption.
ZGenerational ZGC mode organises objects into young and old generations, allowing tailored garbage collection strategies. Fast incremental sweeps in the young generation ensure responsive performance, while comprehensive, less frequent clean-ups in the old generation maintain stability over time, exclusively supported in recent JDK versions like JDK 21
-XX:+UseZGC -XX:+ZGenerational
ZGC got production ready in JDK 15, focuses more on lower latency, but can also increase throughput in many cases.
-XX:+UseZGC