Quick revision
The short answer
As incident lead, we stabilise first: if the release timing matches, we roll back, and we add capacity to absorb restarts while it rolls out. We split the work into roles for communication, mitigation and investigation, and before the evidence disappears we take one affected pod out of the load balancer and capture a heap dump or JFR recording to secure storage. After recovery we find the root cause from that evidence, add an alert on heap after GC growing, hold a blameless review and add a memory soak test to the release process.
What to remember
In this answer, we led the response to a memory leak that made 40 checkout pods restart at peak. We stabilised first by rolling back the matching release and adding capacity, assigned separate roles for communication, mitigation and investigation, and captured evidence from one isolated pod before the rollback removed it, storing dumps securely because they contain customer data. After recovery we found the root cause, added an alert on heap after GC growing, held a blameless review and added a memory soak test to the release process.
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.
As incident lead, we stabilise first: if the release timing matches, we roll back, and we add capacity to absorb restarts while it rolls out. We split the work into roles for communication, mitigation and investigation, and before the evidence disappears we take one affected pod out of the load balancer and capture a heap dump or JFR recording to secure storage. After recovery we find the root cause from that evidence, add an alert on heap after GC growing, hold a blameless review and add a memory soak test to the release process.
Why this question is asked
When 40 pods of a checkout service restart at peak traffic, the company is losing orders every minute, and everyone wants to help at once. The hardest part of leading such an incident is not the technical diagnosis; it is keeping the response ordered so that customers recover quickly and the evidence needed for a lasting fix is not lost in the rush. Interviewers ask this question to see whether we can lead under pressure and still think about the follow-up. In this answer, we will walk through the first minutes, the roles, how to capture evidence without slowing recovery, the investigation after recovery, and the review that prevents a repeat.
1The First Minutes: Stabilise Before Investigating
The first goal is to stop customer impact, not to understand the bug. So the first question is what changed. If a release went out a few hours ago and the restarts started after it, the most likely cause is the release, and rolling back is the fastest fix. Rolling back is safe when the release has no irreversible changes, such as database migrations that the old version cannot handle, so we check that quickly with the release owner.
While the rollback rolls out, which may take 10 to 20 minutes for 40 pods, the restarting pods keep failing. Each pod that restarts loses its in-flight requests and its traffic moves to the others, which then fill up faster. So we add capacity, for example scaling from 40 to 60 pods, so each pod receives less traffic and takes longer to reach the limit. If clients retry aggressively, we may also need to shed some load, such as disabling a non-essential feature, to prevent a retry storm from keeping the service down.
2Assigning Roles
An incident with ten people in a channel and no structure produces duplicated work and missed steps. So the incident lead assigns roles and does not take one of the technical roles personally, staying free to coordinate and decide.
One person handles communication: status updates every 15 or 30 minutes to support, management and, if needed, customers, with what we know, what we are doing and when the next update comes. One person or a small group handles mitigation: the rollback, scaling and load shedding. One person handles investigation: capturing evidence and starting to look at it, without blocking mitigation. Separating these means the person rolling back is not interrupted by questions from executives, and the investigator is not pressured into stopping the rollback to collect one more data point.
| Role | Focus | Example actions |
|---|---|---|
| Incident lead | decisions and coordination | approve rollback, assign roles, track timeline |
| Communication | stakeholders | status every 30 minutes to support and management |
| Mitigation | customer impact | roll back, scale 40 to 60 pods, shed load |
| Investigation | evidence | isolate one pod, heap dump, JFR, secure upload |
3Capturing Evidence Before It Is Lost
The rollback will fix the symptoms and destroy the evidence: once every pod runs the old version, there is no leaking process left to inspect. So in parallel with mitigation, the investigator takes one affected pod out of traffic and captures data from it. In Kubernetes, removing the label that the Service selects on detaches the pod from the load balancer and from its ReplicaSet, which starts a replacement, so we do not lose capacity and the isolated pod stays alive for inspection.
7 messages in order. Play them, or step through them one at a time.
Notice the order: the JFR dump and histogram are fast and small, so they come first; the heap dump is large and pauses the JVM, which no longer matters because the pod has no traffic. If HeapDumpOnOutOfMemoryError was configured, some pods may already have written dumps, and we collect those too.
The dumps go straight to secure storage: an encrypted bucket with access limited to the investigators. A checkout service heap dump contains customer names, addresses, carts and possibly payment tokens. Copying it to a laptop or attaching it to a chat message would turn a reliability incident into a data protection incident.
4After Recovery: Root Cause and an Early Warning
Once the old version is running everywhere and restarts have stopped, the pressure drops and the investigation can be careful. We open the heap dump, find the collection that dominates the heap and follow its path to a GC root, and compare it with the release's changes. A typical result is a new cache without a size limit or a new metric tagged with an unbounded value. The fix goes through normal review and testing, not a hurried hotfix, because the rollback already protects customers.
We also ask why we found out at peak traffic. The leak must have been growing since the release went out. An alert on heap occupancy after GC growing steadily, for example by 20 percent over six hours, would have warned us hours before the first restart. Adding that alert, if it does not exist, is an immediate action item.
5The Blameless Review and the Process Change
The review is blameless: its aim is to understand how the system, including our processes, allowed the leak to reach production at peak, not to find who wrote the bug. The engineer who wrote the cache made a reasonable change that our process failed to catch. Blaming people teaches everyone to hide mistakes, which makes the next incident longer.
The review covers the timeline, what went well, such as fast rollback and preserved evidence, what went badly, such as late detection, and concrete actions with owners. For a memory leak, the key process change is a memory soak test: running the release candidate under realistic load for 12 to 24 hours and checking that heap after GC and resident memory stay flat before it can go to production. We might also release on a schedule that avoids peak hours, and canary new versions on a small share of pods for long enough to see a slow leak.
6Follow-up questions
Would you ever skip the rollback and hotfix forward?
Only if rolling back is unsafe, for example because a schema change cannot be undone, or if we know the exact bug and a one-line fix can be deployed faster than the rollback. Even then, we add capacity and capture evidence first. In most cases rollback is faster and less risky than writing code under pressure.
What if the timing does not match a release?
Then we look for other changes: a configuration change, a traffic pattern such as a marketing campaign, a dependency that became slow and causes requests to pile up in memory. Capacity and load shedding still buy time, and the evidence from an isolated pod becomes even more important because we have no obvious suspect.
7Conclusion
In this answer, we led the response to a memory leak that made 40 checkout pods restart at peak. We stabilised first by rolling back the matching release and adding capacity, assigned separate roles for communication, mitigation and investigation, and captured evidence from one isolated pod before the rollback removed it, storing dumps securely because they contain customer data. After recovery we found the root cause, added an alert on heap after GC growing, held a blameless review and added a memory soak test to the release process.
Open with
My first goal is to stop customer impact, not to find the bug. If the restarts started after a release, I would roll back, after a quick check with the release owner that there is no irreversible migration, and at the same time scale out, say from 40 to 60 pods, so each pod fills more slowly while the rollback rolls out, and shed non-essential load if retries pile up.
Then, if they want more
I would assign roles right away: one person on communication with updates every 30 minutes, one on mitigation, one on investigation, and I stay as coordinator.
Because the rollback will destroy the evidence, the investigator removes one leaking pod from the Service by changing its label, which also lets the ReplicaSet replace it, then takes a JFR dump, a class histogram and a heap dump from it, and uploads them to an encrypted incident bucket, never a laptop, since a checkout heap holds customer data.
After recovery we analyse the dump calmly, find the unbounded cache or metric in the release, and fix it through normal review. We add an alert on heap after GC rising, so next time we hear about it hours earlier. Then a blameless review with owned actions, especially a 12 to 24 hour memory soak test before releases.
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 "You are incident lead. A memory leak in a new release makes 40 pods of the checkout...": https://scrivio-interview-library.netlify.app/java/jvm-diagnostics/565604f17b/