Module 06 · Memory management · Drill
Memory management drill
Scenario prompts that check whether memory management is usable under pressure. Answer out loud, then compare.
0 of 4 graded
Prompt 1
A Kubernetes pod running a JVM service with -Xmx4g and a memory limit of 4.5 GB is killed every few hours with exit code 137, although heap usage graphs never exceed 3.2 GB. Explain where the memory goes, how you would confirm it, and how you would size the limit.
Prompt 2
A search service memory-maps a 60 GB index on 64 GB machines. After a deploy that added a feature, p99 latency rises from 15 ms to 400 ms, CPU drops, and disk read IOPS climbs. Explain the mechanism, what metrics prove it, and three ways to fix it.
Prompt 3
An in-memory key-value store with a 200 GB dataset on a 256 GB machine shows high CPU with a low instructions-per-cycle rate, and perf stat reports a very high dTLB miss rate. Explain why, and what you would change at the OS and data-structure level.
Prompt 4
A Go service's resident memory grows from 1 GB to 6 GB over a day while the live heap reported by the runtime stays near 800 MB, and a C++ sidecar on the same node shows similar slow growth with no leaks. Diagnose both, and explain how garbage collection settings and allocator choices interact with container limits.