GitLab Well Architected
Cookbook navigation
Prompts / Debug Memory Leak

Debug Memory Leak

DebuggingDeveloperMonitorBeginner

Find memory leaks by analyzing object lifecycles and retention issues.

For GitLab Duo

prompt

Investigating memory leak:

Observations: [DESCRIBE MEMORY GROWTH]
Code area: [SUSPECT CODE/COMPONENT]
Memory profile: [PASTE DATA IF AVAILABLE]

Help me:
1. Find what's not being released
2. Identify the leak source
3. Explain why objects are retained
4. Suggest the fix

Use the prompt

Share how memory changes over time, along with the workload and any profiling results. Comparing retained objects before and after the operation gives the investigation a more concrete starting point.