Find a Memory Leak in Python
Talk it through out loud with your AI coach.
The problem
- medium
- Pro
A long-running Python web service's memory grows steadily over days until it's restarted. Python has a garbage collector, so a teammate says it can't be a leak. Explain how Python programs leak memory and how you'd find the cause.
What a strong answer covers
- Why a garbage-collected language can still leak.
- The usual culprits in long-running services.
- A standard tool for locating where the memory is going.
- Confirming the cause and preventing it from recurring.
Common mistake: Calling the garbage collector manually or restarting on a schedule, which hides the growth without finding what holds the references.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud