AdvancedScenario
15 min

Application Memory Leak

MemoryProfilingDebugging
Advertisement
Interview Question

A service shows steadily increasing memory usage until it crashes. How do you investigate and remediate this memory leak?

Key Points to Cover
  • Confirm leak via monitoring (RSS, heap growth)
  • Capture heap dumps and analyze object retention
  • Use profilers (jmap, go pprof, etc.) to locate leaks
  • Patch code and test fix under load
  • Add memory usage alerts and autoscaling as safeguard
Evaluation Rubric
Confirms memory leak growth pattern30% weight
Uses heap/profile tools effectively30% weight
Explains remediation steps clearly20% weight
Mentions monitoring/autoscaling safeguards20% weight
Hints
  • 💡Leaks may be from caches, goroutines, or event listeners.
Potential Follow-up Questions
  • How do you replicate in staging?
  • What’s the role of GC tuning?
Advertisement