Ctrl K
Java · Senior · Theory

You have a Java service with a 30 GB heap, and the business is complaining about long pauses. How would you choose and tune the garbage collector?

~4 min by voice

How to approach it

The interviewer wants to see whether you diagnose a pause problem from data rather than tweaking flags blindly, whether you understand how G1 and modern low-pause collectors (ZGC, Shenandoah) work, whether you know their cost, and whether you can verify a change safely in production.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsA service running on G1 periodically has pauses of one to two seconds, and it's hurting latency. What would you do, and when is it worth looking at a different garbage collector? Mid-levelWhat is the garbage collector in Java, and how does it figure out which objects can be removed? JuniorYour Java service has to respond with a p99 of no more than ten milliseconds. How would you design it with the JVM's characteristics in mind, and how would you find the source of latency if the target isn't being met? SeniorHow does memory management work in Python? How are objects that are no longer needed removed? JuniorHow does memory management work in CPython? And how would you track down a memory leak in a long-running Python process? Senior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min