Quick revision
The short answer
Before adopting a collector, I check whether it exists in every JDK build the service might run on, because moving a service to an image without it breaks startup. I would compare Shenandoah against generational ZGC, which every OpenJDK build includes, on the team's real workload; if ZGC meets the latency target I choose it, and if Shenandoah clearly wins, I allow it as a documented, supported exception with its vendor build pinned and owned, plus metrics and an exit plan. Separately, I would ask whether the fleet should standardise on one vendor, since this kind of divergence will keep coming back.
What to remember
In this answer, we saw that the first question with any collector is whether it exists in every build the service may run on, because Shenandoah's absence from some vendors' builds turns an image change into a startup failure. We compare it with generational ZGC, available in every OpenJDK build, on the team's real workload. If ZGC meets the target, we use it; if Shenandoah clearly wins, it becomes a documented exception with a pinned build, an owner, metrics and an exit plan. And we raise the broader question of standardising on one vendor.
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.
Before adopting a collector, I check whether it exists in every JDK build the service might run on, because moving a service to an image without it breaks startup. I would compare Shenandoah against generational ZGC, which every OpenJDK build includes, on the team's real workload; if ZGC meets the latency target I choose it, and if Shenandoah clearly wins, I allow it as a documented, supported exception with its vendor build pinned and owned, plus metrics and an exit plan. Separately, I would ask whether the fleet should standardise on one vendor, since this kind of divergence will keep coming back.
Why this question is asked
Platform decisions are rarely about which technology is best in isolation. They are about what a fleet can support reliably. A team asking for Shenandoah on a mixed-vendor fleet is a good example: the request is reasonable, the technology is good, and yet saying yes without conditions creates a service that breaks the first time someone moves it to the standard image. Interviewers ask this to see how we weigh one team's needs against fleet-wide costs. In this answer, we will recap the availability problem, walk through the decision step by step, look at what a supported exception must include, and consider the larger question of standardising vendors.
1A Quick Recap: Why Availability Matters
Shenandoah is included in many OpenJDK builds, such as Red Hat's, Amazon Corretto and Eclipse Temurin, but not in Oracle JDK builds. A JVM started with -XX:+UseShenandoahGC on a build without it does not fall back to another collector; it refuses to start.
In a fleet with two vendors, services move between images more often than teams expect. A base image update, a security rebuild, a migration to a new cluster that uses the platform default, or a developer copying the deployment of another service can all switch the build. If the service's flags depend on a collector that one build lacks, any of these turns into an outage at deploy time, and usually during an urgent change, which is the worst time to discover it.
2Walking Through the Decision
The decision follows a short sequence. We start by stating the requirement in numbers, then test the option that works everywhere, and only then consider the exception.
- State the latency target in numbersand confirm GC is the cause
- Does the default (G1) meet it?YesStay on the defaultNoTest low-pause collectors
- Benchmark ZGC and Shenandoah on real loadsame build, heap, instance
- Does generational ZGC meet the target?YesUse ZGC: available in every buildNoConsider an exception
- Does Shenandoah clearly win?YesSupported exception: pin build, owner, exit planNoRevisit the target or the design
5 steps in order. Play them, or step through them one at a time.
The first step is turning 'latency-sensitive' into a target, for example p99.9 under 20 ms at 3,000 requests per second, and confirming GC is actually the problem; if the long tail comes from a downstream call or lock contention, no collector change will help.
The second step is a fair comparison. Generational ZGC is in every OpenJDK build on JDK 21 and later, so it is the obvious alternative. We run both collectors on the same production-like load, same instance type and heap, and compare tail latency, GC CPU, memory use and any stalls or degenerated cycles. Shenandoah may well win on a heap under 32 GB because it keeps compressed oops; ZGC may win on consistency. The data decides.
If ZGC meets the target, we choose it: the team gets its latency, and the service stays portable. If Shenandoah clearly wins, for example p99.9 of 12 ms against ZGC's 25 ms with a 20 ms target, it becomes an exception.
3What a Supported Exception Includes
An exception is fine; an undocumented exception is a future incident. So I would ask for four things. First, the vendor build is pinned in the service's deployment, not inherited from a shared base image, and the platform's build pipeline treats that image as supported, with security updates on the same schedule as the standard one.
Second, there is an owner: a named team responsible for testing the service on each JDK update of that build. Third, there are metrics that justify the exception, such as the latency and GC CPU numbers from the comparison, collected continuously so we can see if the advantage remains. Fourth, there is an exit plan: a tested configuration with generational ZGC, ready to use if the vendor build is dropped or the advantage disappears in a later JDK. A startup check helps too: if the service's deployment test fails fast when the collector is missing, the problem appears in CI, not in production.
The reason for all this is cost. Each exception adds a combination to test on every JDK upgrade, another set of GC logs to understand during incidents, and knowledge that only a few people have. Making those costs visible keeps exceptions rare and deliberate.
4The Larger Question: One Vendor or Two?
This request also reveals a fleet-level issue. Two JDK vendors mean two sets of release notes, two security update schedules, two sets of supported options, and bugs that appear in one build but not the other. Shenandoah is only the most visible difference.
I would not force a vendor change for one service, but I would raise the question with the platform owners. If the second vendor exists for a historical reason, standardising on one build, ideally one that includes all OpenJDK collectors, removes this whole category of problem. If both are needed, for example for licence or support reasons, the platform should publish which features are guaranteed in all supported images, so teams can see the boundary before they design around it.
5Follow-up questions
Why not simply allow Shenandoah and let the team manage it?
Because the costs do not stay with the team. When the service fails to start after a base image change, the incident lands on whoever made the change, often the platform team. When a JDK update arrives, someone has to test the extra combination. Allowing it with conditions keeps the benefit for the team while making sure the fleet-level costs are owned.
What if the measurements show only a small difference?
Then the portable option wins. A 10 percent improvement in p99.9 rarely justifies a permanent exception if ZGC already meets the target. The exception should be reserved for cases where the standard option fails the requirement, not where the alternative is slightly better.
How often should the exception be reviewed?
At every JDK LTS upgrade at minimum, and whenever the vendor's support terms change. Low-pause collectors improve quickly, so a gap measured on one release may close on the next, and then the exception can be retired.
6Conclusion
In this answer, we saw that the first question with any collector is whether it exists in every build the service may run on, because Shenandoah's absence from some vendors' builds turns an image change into a startup failure. We compare it with generational ZGC, available in every OpenJDK build, on the team's real workload. If ZGC meets the target, we use it; if Shenandoah clearly wins, it becomes a documented exception with a pinned build, an owner, metrics and an exit plan. And we raise the broader question of standardising on one vendor.
Open with
My first concern is availability, not performance. Shenandoah is in builds like Corretto, Temurin and Red Hat's, but not in Oracle's, and a JVM started with UseShenandoahGC on a build without it just refuses to start.
Then, if they want more
In a two-vendor fleet services move between images through base image updates or cluster migrations, so a collector that is missing from one build is a deploy-time outage waiting to happen. So I would first pin down the team's latency target in numbers and confirm GC is really the cause.
Then I would benchmark Shenandoah against generational ZGC, which is in every OpenJDK build, on their real workload with the same heap and instance type, comparing tail latency, GC CPU and memory. If ZGC meets the target, we use ZGC and the service stays portable.
If Shenandoah clearly wins and ZGC misses the target, I would approve it as a supported exception: the vendor build pinned in the deployment, a named owner who tests it on every JDK update, metrics that keep justifying it, a CI check that fails fast if the image lacks the collector, and a tested ZGC configuration as the exit plan.
Finally, I would raise with the platform owners whether we should standardise on one vendor, because this divergence will come up again.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Java 21
- 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
- HotSpot Garbage Collection Tuning Guide, JDK 21
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 "Your fleet uses JDK builds from two vendors. One team wants Shenandoah for a...": https://scrivio-interview-library.netlify.app/java/garbage-collection/0900e34fc9/