Day 19: Memory That Leaks, Memory That Is Busy, and Pauses to Tidy Up
Illustrative interview practice. Generic company names and hostnames do not represent any specific organization.
Scenario
Interviewer A service is getting slower and some requests time out. Its memory use is high and its processor use jumps now and then. Is this a memory leak, the cost of cleaning up memory, or simply heavy traffic? And why can giving the program more memory make its slowest requests slower?
In plain words
Three different problems can produce the same picture of high memory and slow replies. The question asks how you would tell them apart. The interviewer is looking for what you would plot and compare, not a guess.
The second part sounds backwards on purpose. More memory seems like it should always help. You are asked to explain a case where it does not.
Words you need
| Word | What it means |
|---|---|
| Heap | The area of memory where a program keeps the things it creates while running. |
| Garbage collection (GC) | The automatic tidy-up in languages such as Java: finding things no longer in use and freeing their memory. |
| Pause | A moment when the program stops answering requests so the tidy-up can run safely. |
| Memory leak | A fault where a program keeps hold of things it no longer needs, so its memory use only grows. |
| Heap dump | A file containing everything in the heap at one instant, for studying later. |
Your answer
2:00
Observe → Hypothesise → Investigate → Mitigate → Prevent. The timer is optional; your answer is not auto-submitted.
0 / 20,000 characters · Not saved