advanced
Memory Leak Debugging Protocol
Outline a systematic protocol for identifying and resolving memory leaks in long-running processes.
📝 Nội dung Prompt
Create a systematic diagnostic protocol for identifying memory leaks in a long-running backend service written in a high-level language (e.g., Java, Go, or Python). The service shows a gradual increase in heap usage but no immediate OutOfMemory errors. Outline a step-by-step investigation process including: 1) The specific tools and metrics to monitor in production. 2) The process for capturing and analyzing heap dumps and CPU profiles. 3) How to differentiate between a true memory leak, a memory fragmentation issue, and a legitimate increase in cache size. 4) Techniques for tracing object retention paths to identify the root cause of unintentional object references.