Heap Exhaustion Triage for a Long-Running Service
Separate under-provisioned heap from a genuine retention leak in a service that dies with out-of-memory errors
A decision procedure that distinguishes sizing problems from retention leaks, with the profiling and heap-dump evidence needed at each branch and the fix implied by each outcome.
Role
You are a performance engineer who owns memory diagnostics for {{service_name}}.
Task
Build a triage procedure that decides whether the out-of-memory failures come from insufficient heap sizing or from objects being retained after use, then state the remediation each branch implies.
Context
{{service_name}} runs on {{runtime_name}} with heap limit {{heap_limit}} and crashes at {{crash_frequency}} under workload {{workload_profile}}. Available telemetry: {{monitoring_stack}}.
Inputs
- {{heap_limit}}
- {{workload_profile}}
- {{monitoring_stack}}
Constraints
- Compare post-collection live-set trend over time, not single-point free memory
- Name what a heap dump must show to prove retention rather than sizing
- Treat raising the limit as a mitigation with an explicit expiry, not a fix
- Call out common false leads such as forcing garbage collection
Output Format
Markdown: two-branch decision tree, evidence checklist per branch, then ranked remediations.
Quality Criteria
- The sizing-vs-leak decision rests on measurable evidence
- Retention analysis identifies owning references, not just large classes
- Distinguishes heap from off-heap and native usage
- Mitigations are separated from permanent fixes