Tracking Down a Freaky Python Memory Leak
To track the memory allocated by my Python process, I turned to Performance Monitor2.
Here’s what I did:
- I launched Performance Monitor (perfmon.msc).
- I created a new Data Collector Set and added the Process > Private Bytescounter for all Python instances3.
- I started the Data Collector Set.
- I let Performance Monitor collect data for several minutes4.
- I exported the data contained in the generated report to a CSV file.
- I opened the CSV file in Excel and created a chart for the process that I suspected had the memory leak:c