aiofiles icon indicating copy to clipboard operation
aiofiles copied to clipboard

Memory continue to grow while reading large file

Open Jeffwhen opened this issue 7 years ago • 0 comments

async with aiofiles.open(fileName) as f:
    i = 0
    async for line in f:
        i += 1
        print(i, len(line))

Memory usage grows like there's no tomorrow.

Using explicit executor and close it after every usage seems to solve this problem. But I don't know why it works. What happens to those run_in_executor coroutine data?

Jeffwhen avatar May 09 '18 04:05 Jeffwhen