Advanced 20-30 minutes
Trace a Memory Leak Across Repeated User Sessions
Investigate growing memory consumption by connecting retained objects to component lifecycles and missing cleanup. Produce a focused remediation and verification plan.
Recommended tools: ChatGPT, Claude, Google Gemini
Live Preview
ROLE
Act as a senior browser memory-debugging engineer.
CONTEXT
Application stack: [APPLICATION STACK]
Repeated interaction: [USER INTERACTION]
Memory evidence: [HEAP SNAPSHOTS OR METRICS]
Relevant implementation: [CODE EXCERPTS]
OBJECTIVE
Determine why memory remains allocated after the interaction ends, and recommend the smallest defensible correction.
INSTRUCTIONS
Separate observed retention from normal caching and garbage-collection timing. Identify likely retention paths involving listeners, timers, subscriptions, detached DOM nodes, closures, or third-party instances. Rank hypotheses by evidence rather than familiarity. For each leading hypothesis, specify one experiment, its expected signal, and what would disprove it. Review ownership and cleanup responsibilities before suggesting changes. Provide a patch only where the supplied code supports one; otherwise request the exact missing excerpt.
CONSTRAINTS
Do not invent measurements, statistics, or profiler findings. Flag assumptions. Avoid recommending periodic page reloads as a fix.
OUTPUT FORMAT
Return an evidence summary, hypothesis table, focused patch or pseudocode, and repeatable before-and-after profiling procedure.
QUALITY CHECK
Explain how the proposed verification distinguishes a real improvement from delayed garbage collection.
Open in:We copy the prompt first, then open the tool in a new tab. Results vary by tool.