Quick revision
The short answer
The trends point to a strategy built on measurement: benchmark services on both ARM and x86, since current JDKs support ARM well and it can lower cost, and choose instance types by measured cost per request rather than habit. More cores reward designs with little lock contention and shared mutable state, memory bandwidth limits make allocation rate and data layout matter more, and keeping JDK versions current brings CPU-specific optimisations and intrinsics. None of it works unless every native dependency is available for every architecture we plan to use.
What to remember
In this answer, we turned hardware trends into a Java performance strategy. ARM servers are well supported by current JDKs and can lower cost, so we benchmark services on both architectures and choose instances by measured cost per request at a latency target. More cores reward designs with little lock contention and shared mutable state, memory bandwidth limits make allocation rate and data layout more important, and current JDKs bring hardware-specific optimisations and intrinsics. Native dependencies must exist for every architecture, and the whole plan runs as a repeating loop owned by a platform team.
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.
The trends point to a strategy built on measurement: benchmark services on both ARM and x86, since current JDKs support ARM well and it can lower cost, and choose instance types by measured cost per request rather than habit. More cores reward designs with little lock contention and shared mutable state, memory bandwidth limits make allocation rate and data layout matter more, and keeping JDK versions current brings CPU-specific optimisations and intrinsics. None of it works unless every native dependency is available for every architecture we plan to use.
Why this question is asked
Hardware choices used to be made once and forgotten: pick a standard x86 instance type and move on. That is no longer a safe default. Cloud providers now offer ARM-based instances at lower prices, core counts per socket keep rising, caches are growing, and memory bandwidth per core is not keeping up. Interviewers ask this at the director or principal level to see whether we can turn hardware trends into an organisation-wide strategy that is evidence-based rather than fashionable. In this answer, we will look at each trend and what it means for Java services, then put them together into a five-year plan with owners and measurements.
1ARM Servers: Benchmark, Do Not Assume
ARM-based server instances, such as AWS Graviton, Azure's and Google Cloud's ARM offerings, and Ampere-based machines, are well supported by current JDKs. The Linux AArch64 port is mature, current OpenJDK builds and the main vendor distributions ship for it, and the JIT and garbage collectors have received years of optimisation work on that architecture. For many Java services, moving is a change of base image and instance type, with no code changes.
But the gain varies by workload. Some services see a clearly better price per request, some see roughly equal results, and a few get worse, for example when they depend on x86-specific native code or on instructions that are better optimised on one side. So the strategy is to benchmark each important service on both architectures with the same load, and compare cost per request, not raw speed.
Notice that the slower instance wins. That is why cost per request at a latency target is the right unit: it combines price, performance and the SLO in one number.
2More Cores Reward Less Sharing
Core counts per socket keep rising, and cloud instances with dozens of vCPUs are routine. A Java service only benefits from more cores if its threads can work independently. A single hot lock, a shared counter updated on every request, or a global synchronized cache becomes the limit long before the cores run out, a practical form of Amdahl's law: the serial part of the work caps the speedup.
So our design guidance should push toward partitioned and immutable state: per-request objects rather than shared mutable ones, concurrent structures such as ConcurrentHashMap and LongAdder instead of a lock around a HashMap, and sharding work by key where ordering matters. Virtual threads help with I/O concurrency on many cores, but they do not remove contention on shared state. Lock contention profiling, for example with JFR's monitor events, should be part of any service's performance review.
3Memory Bandwidth and Big Caches
Cores have multiplied faster than memory bandwidth, so each core gets a smaller share of it. A service that allocates several gigabytes per second, or streams through large object graphs, may hit the memory bandwidth limit on a big machine even though CPU utilisation looks moderate. That makes allocation rate and data layout more important over time: fewer temporary objects, compact data structures and primitive arrays for hot data.
Large caches pull in the other direction. Some recent server CPUs have very large L3 caches, and a service whose working set fits in them can run much faster than on a machine with a smaller cache. Again, the only reliable way to know is to benchmark the actual service, which is why instance choice should come from measurement.
4Keep the JDK Current
Each JDK release brings optimisations for current hardware: intrinsics, hand-tuned machine code for common operations such as array copies, string handling, CRC and cryptography, better use of vector instructions, and collector and JIT improvements, often with work specific to ARM. A service on an old JDK leaves these on the table, and on new hardware the gap tends to be larger.
So staying on a recent LTS, and moving to each new LTS within a planned window, is part of the hardware strategy, not just a security chore. It also keeps container awareness and ergonomics correct, so the JVM sizes its threads and heap properly on whatever instance it lands on.
5Native Dependencies: the Practical Blocker
The most common reason an ARM migration stalls is not Java at all but native code: a JNI library, a compression codec, a native transport for Netty, an embedded database such as RocksDB, a monitoring agent, or a base image that exists only for x86. If one service in a deployment depends on a library without an ARM build, that service cannot move.
So part of the plan is an inventory. We scan dependencies for native libraries and check that each has builds for every architecture we plan to use, build multi-architecture container images in CI, and run the test suite on both architectures. Making this a platform-level check prevents a team from adding an x86-only dependency that quietly blocks a future move.
6Putting It Into a Five-Year Plan
The pieces fit into a plan owned by a platform or performance team, with service teams running their own measurements on shared tooling.
- Keep JDKs on a current LTSplanned upgrade window per release
- Make every service multi-arch readynative dependency inventory, multi-arch images, CI on both
- Benchmark on candidate instance typessame load, same latency target
- Compare cost per requestnot habit, not raw speed
- Is a new choice cheaper at the same SLO?YesMigrate, starting with low-risk servicesNoStay, re-check next cycle
- Feed design guidanceless sharing, lower allocation, compact data
6 steps in order. Play them, or step through them one at a time.
Re-run the loop each year and on each LTS.
The point is that the strategy is a loop, not a one-time migration. Prices change every year, new instance generations appear, and each LTS changes the results. A standing benchmark harness and a cost-per-request dashboard let us re-evaluate cheaply, and the guidance to avoid shared mutable state and watch allocation pays off on any future hardware.
7Follow-up questions
Is it risky to run a mixed fleet of ARM and x86?
It adds some operational work, such as two image variants and testing on both, but it also avoids lock-in to one architecture and lets each service run where it is cheapest. With multi-architecture images and CI on both, the extra cost is small.
Do container CPU limits change how the JVM sees more cores?
Yes. The JVM reads the container's CPU limit and sizes GC threads, the common fork-join pool and other defaults from it. On large instances shared by many containers, it is worth checking what the JVM thinks it has, for example with -XX:+PrintFlagsFinal or by logging Runtime.availableProcessors(), and setting -XX:ActiveProcessorCount when the default is wrong.
What would you do first in the next quarter?
Inventory native dependencies, build multi-architecture images for a few representative services, and benchmark them on ARM and x86 at their real latency targets. That produces the first cost-per-request comparison and tells us how much of the fleet can move easily.
8Conclusion
In this answer, we turned hardware trends into a Java performance strategy. ARM servers are well supported by current JDKs and can lower cost, so we benchmark services on both architectures and choose instances by measured cost per request at a latency target. More cores reward designs with little lock contention and shared mutable state, memory bandwidth limits make allocation rate and data layout more important, and current JDKs bring hardware-specific optimisations and intrinsics. Native dependencies must exist for every architecture, and the whole plan runs as a repeating loop owned by a platform team.
Open with
I would build the strategy around measurement rather than any one bet. First, ARM: current JDKs support AArch64 very well, and ARM instances are often cheaper, but results vary by service, so I would benchmark our main services on both ARM and x86 at their real latency targets and compare cost per request.
Then, if they want more
Sometimes the slower instance is cheaper per request, and that is the number that matters. Second, more cores per socket only help if our services avoid contention, so the design guidance should push toward little shared mutable state: per-request objects, concurrent structures like LongAdder and ConcurrentHashMap, and sharding by key, with lock profiling in performance reviews.
Third, memory bandwidth per core is not keeping up, so allocation rate and compact data layouts matter more over time, while very large caches can reward services whose working set fits. Fourth, keep the JDK current, because each release adds intrinsics and CPU-specific optimisations, including for ARM, and correct container ergonomics.
And the practical blocker is native dependencies, so I would inventory JNI libraries, native transports and agents, build multi-architecture images and run CI on both. A platform team would own this as a yearly loop: upgrade, benchmark, compare cost per request, migrate where it pays.
About this answer
- Last updated
- 12 November 2026
- 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.
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 "Server hardware keeps changing: more cores per socket, ARM-based instances with...": https://scrivio-interview-library.netlify.app/java/java-performance/e2aca5c817/