Document Generation Pipeline Memory Leak Remediation Checklist
Exhaustive forensic checklist to identify, replicate, and patch native memory leaks and worker OOM crashes in high-throughput report engines.
Ideal for diagnosing intermittent worker crashes during end-of-quarter advisory reporting cycles. It systematizes heap profiling, GC pressure checks, unmanaged file handle leaks, and sandboxed rendering dependencies.
Role: Staff Site Reliability Engineer and Backend Performance Architect specializing in high-throughput document processing systems.
Context
- Execution runtime: {{runtime_environment}}
- Document compilation core: {{document_rendering_engine}}
- Queue & Orchestration platform: {{worker_orchestrator}}
- Degradation pattern: {{oom_crash_frequency}}
- Leak trajectory: {{heap_growth_rate}}
- Observability infrastructure: {{telemetry_stack}}
Task
Deliver an advanced diagnostic and triage checklist to pinpoint uncollected memory objects, zombie child processes, and native C++ binding allocations causing worker crashes under heavy report generation loads.
Method
- Formulate diagnostic checks for container cgroup memory limits against {{runtime_environment}} heap allocation configurations.
- Detail step-by-step heap dump acquisition procedures using {{telemetry_stack}} without causing cascading worker timeouts in {{worker_orchestrator}}.
- Create inspection checks to differentiate native memory leaks in {{document_rendering_engine}} from managed runtime garbage collector fragmentation.
- Design audit checks for unclosed file descriptors, dangling event listeners, and stranded headless process trees.
- Establish memory profiling benchmarks to isolate the {{heap_growth_rate}} under simulated concurrency workloads.
- Construct sandbox validation checks to verify whether dynamic asset injection (e.g., large client base64 images, complex SVG charts) triggers memory retention.
- Detail worker recycling safety thresholds and canary deployment verification steps to stabilize the {{oom_crash_frequency}}.
Constraints
- MUST distinguish clearly between resident set size (RSS), heap allocated memory, and external/native buffer allocations.
- MUST NOT require profiling procedures that increase worker latency by more than 15% during live traffic.
- Every checklist item MUST prescribe the exact CLI command, profile metric, or inspection tool required.
- Include explicit thresholds for triggering worker graceful restarts versus hard terminations.
Output format
Provide the checklist organized into 4 logical execution phases: 1. Telemetry Triage & Process State, 2. Heap & Native Memory Profiling, 3. Resource Lifecycle & Subprocess Auditing, and 4. Stabilization & Mitigation Gates. Format each entry as [ ] [Phase-Step#] [Checkpoint Name]: [Inspection Procedure] | Tool/Metric: [Tool or Command] | Target Status: [Explicit Healthy Value].
Self-review
- Verify that {{runtime_environment}}, {{document_rendering_engine}}, {{worker_orchestrator}}, {{oom_crash_frequency}}, {{heap_growth_rate}}, and {{telemetry_stack}} are seamlessly woven into the text.
- Ensure steps rigorously address native engine crashes rather than superficial code bugs.
- Confirm the checklist adheres to the output formatting structure.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.