Quick revision
The short answer
For operations teams, the important changes between Java 9 and 17 are in the runtime, not the language: G1 became the default garbage collector in Java 9, the JVM learned to respect container CPU and memory limits in Java 10 (backported to 8u191), unified logging with -Xlog replaced the old GC logging flags in Java 9, ZGC and Shenandoah became production-ready in Java 15, Java Flight Recorder was open-sourced in Java 11, and strong encapsulation became the default in 16 and was enforced in 17. Each of these changes the flags, dashboards or failure modes that operations depend on.
What to remember
In this answer, we went through the runtime changes between Java 9 and 17 that operations teams feel: G1 as the default collector and the removal of CMS, container awareness from Java 10 and 8u191 with percentage-based heap sizing, unified logging with -Xlog replacing old GC flags and log formats, ZGC and Shenandoah ready for production in 15, JFR open-sourced in 11 and usable in production through jcmd, and strong encapsulation becoming the default in 16 and enforced in 17.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
For operations teams, the important changes between Java 9 and 17 are in the runtime, not the language: G1 became the default garbage collector in Java 9, the JVM learned to respect container CPU and memory limits in Java 10 (backported to 8u191), unified logging with -Xlog replaced the old GC logging flags in Java 9, ZGC and Shenandoah became production-ready in Java 15, Java Flight Recorder was open-sourced in Java 11, and strong encapsulation became the default in 16 and was enforced in 17. Each of these changes the flags, dashboards or failure modes that operations depend on.
Why this question is asked
Developers notice records and switch expressions; operations teams notice that startup scripts stop working, GC logs look different and memory settings behave differently in containers. Interviewers ask this question to senior engineers because an upgrade from 8 to 17 succeeds or fails on these details. In this answer, we will go through the garbage collector changes, container awareness, the new logging system, the low-latency collectors, Flight Recorder, and the encapsulation change, with the flags that matter for each.
1G1 Becomes the Default Collector in Java 9
A garbage collector reclaims memory from objects that are no longer used. Up to Java 8, the default on servers was the Parallel collector, which is fast in total throughput but stops the application for the whole collection, which can take seconds on a large heap. Java 9 made G1 the default. G1 splits the heap into regions and aims for a pause-time goal, 200 ms by default, collecting the regions with the most garbage first.
For operations this means an upgraded service may behave differently even with unchanged flags: shorter pauses, slightly more CPU spent on GC, and a different memory footprint. CMS, the older low-pause collector, was deprecated in 9 and removed in 14, so any -XX:+UseConcMarkSweepGC flag in a startup script makes the JVM refuse to start on 14 and later.
2Container Awareness in Java 10, Backported to 8u191
Before container support, the JVM looked at the host machine. A container limited to 2 CPUs and 1 GB of memory on a 64-core, 256 GB host would size its heap and thread pools for the host, use a quarter of 256 GB as its default maximum heap, and get killed by the kernel for exceeding the container's limit. Java 10 made the JVM read the cgroup limits, and the change was backported to Java 8 update 191.
With container support, the default maximum heap is a quarter of the container's memory. That is usually too low for a dedicated service, so we set it as a percentage instead of a fixed size, which keeps working when the container's limit changes.
Notice that the processor count also follows the limit, which changes the default number of GC threads and the size of the common ForkJoinPool. Later releases added cgroup v2 support, so check your version if hosts use cgroup v2.
3Unified Logging Replaces the Old GC Flags
Java 9 introduced unified JVM logging, one system for all JVM log output, configured with -Xlog. GC logging moved onto it, and flags such as -XX:+PrintGCDetails and -Xloggc were removed or turned into warnings. A Java 8 startup script with these flags either fails or quietly stops producing the GC logs that dashboards parse.
Notice that the log format changed too, so log parsers and GC analysis tools must be updated along with the flags. The benefit is a consistent format with tags and built-in rotation.
4ZGC and Shenandoah, and Flight Recorder for Everyone
Java 15 made two low-latency collectors production-ready: ZGC, from Oracle, and Shenandoah, from Red Hat. Both do almost all their work while the application runs, so pauses stay around a millisecond even with very large heaps, at the cost of some extra CPU and memory. They are chosen with -XX:+UseZGC or -XX:+UseShenandoahGC; Shenandoah is not included in every vendor's build, so check yours.
Java Flight Recorder, JFR, was a commercial feature of the Oracle JDK until Java 11, when it was open-sourced into OpenJDK. JFR records events such as GC pauses, lock contention, allocation and method samples with very low overhead, often around one percent, so it can run in production. Operations teams can start a recording on a live process with jcmd.
| Release | Change | What operations must do |
|---|---|---|
| 9 | G1 default, unified logging -Xlog | Rewrite GC flags and log parsing |
| 10 (8u191) | Container awareness | Use MaxRAMPercentage, check limits |
| 11 | JFR open-sourced | Use jcmd JFR.start in production |
| 14 | CMS removed | Remove CMS flags from scripts |
| 15 | ZGC and Shenandoah production-ready | Consider for large heaps, low latency |
| 16 and 17 | Strong encapsulation default, then enforced | Track --add-opens flags |
5Strong Encapsulation in 16 and 17
The last change looks like a developer issue but often lands with operations. Java 16 denied illegal reflective access to JDK internals by default, and Java 17 removed the --illegal-access option. A service whose libraries reflect into the JDK fails at startup or on first use with InaccessibleObjectException. The fixes are library upgrades or specific --add-opens flags, and those flags end up in startup scripts and container definitions that operations maintain, so they need to be documented and owned. Other startup flags were removed in these releases as well, and the JVM refuses unknown -XX options, so the first step of any upgrade is to run the existing startup command on the new JDK.
6Follow-up questions
Why does the default heap look too small after moving to containers?
Because with container support the default maximum heap is 25 percent of the container's memory limit. On a 2 GB container that is 512 MB, while the service may need more. Setting -XX:MaxRAMPercentage to around 70 to 80 percent, leaving room for metaspace, thread stacks and direct buffers, is the usual fix.
Are there any changes in this range that reduce memory use?
Yes. Compact strings in Java 9 store Latin-1 strings with one byte per character instead of two, which often reduces heap use noticeably for text-heavy services. G1 also returns unused memory to the operating system more promptly since Java 12, which matters in containers billed by memory.
What should be on the checklist for an 8 to 17 upgrade from the operations side?
Startup flags that were removed, GC logging flags and parsers, heap sizing in containers, monitoring agents that need new versions, JFR as a new diagnostic tool, and any --add-opens flags the applications need. Run each service's real startup command on the new JDK early.
7Conclusion
In this answer, we went through the runtime changes between Java 9 and 17 that operations teams feel: G1 as the default collector and the removal of CMS, container awareness from Java 10 and 8u191 with percentage-based heap sizing, unified logging with -Xlog replacing old GC flags and log formats, ZGC and Shenandoah ready for production in 15, JFR open-sourced in 11 and usable in production through jcmd, and strong encapsulation becoming the default in 16 and enforced in 17.
Open with
The language changes are what developers talk about, but for operations the runtime changes matter more. In Java 9, G1 replaced Parallel as the default collector, so pause behaviour and CPU use change even with the same flags, and CMS was later removed in 14, so old CMS flags stop the JVM from starting.
Then, if they want more
Container awareness arrived in Java 10 and was backported to 8u191: the JVM reads the cgroup limits for CPU and memory instead of the host's, so we size the heap with MaxRAMPercentage, for example 75 percent, rather than a fixed -Xmx.
Java 9 also introduced unified logging with -Xlog, which replaced PrintGCDetails and -Xloggc, so startup scripts and log parsers both need updating; the upside is built-in rotation and a consistent format. In Java 15, ZGC and Shenandoah became production-ready, which gives roughly millisecond pauses on large heaps for latency-sensitive services.
In Java 11, Flight Recorder was open-sourced, so we can run low-overhead recordings in production and start them with jcmd. And finally, strong encapsulation became the default in 16 and was enforced in 17, so services whose libraries reflect into JDK internals fail unless the libraries are upgraded or specific --add-opens flags are added, and those flags need owners.
My first upgrade step is always running the real startup command on the new JDK.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Java 9, Java 8, Java 10, Java 11
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- The Java Language Specification, Java SE 21, Java SE 21 API documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Which JVM and runtime changes between Java 9 and 17 affect operations teams, as opposed...": https://scrivio-interview-library.netlify.app/java/java-versions/59cc680f71/