Q&A
Q&AHow can tracemalloc help diagnose Python memory growth?
Compare traced allocation snapshots to identify Python allocation sites, then verify process-level memory too.
Read the concise answer
Start tracemalloc before the workload, take snapshots at comparable points, and compare line-level allocation differences. It tracks Python-managed allocations, not every native allocation from extensions or system libraries. Correlate it with RSS and object-retention behavior; growing allocation totals do not alone prove a leak if objects are later freed.