This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Evgeny Nizhibitsky
Recipients Evgeny Nizhibitsky, asvetlov, yselivanov
Date 2019-10-10.09:41:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570700494.14.0.073826419802.issue38430@roundup.psfhosted.org>
In-reply-to
Content
I have run into a memory leak caused by using run_in_executor + ThreadPoolExecutor while running some stability tests with custom web services.

It was 1 MB leaked for 1k requests made for my case and I've extracted the root cause and converted it into minimal script with both mentioned parts + just NOP function to "run".

The script can easily eat up to 1 GB of memory in less then 1 minute now. It uses external psutil library to report the memory allocated but it can be easily commented out and the leak will stay anyway.

One can found that script attached + Dockerfile/Makefile for reproducibility. I've also reproduced it in my own conda-based 3.7 environment as well as the master branch of cpython.
History
Date User Action Args
2019-10-10 09:41:34Evgeny Nizhibitskysetrecipients: + Evgeny Nizhibitsky, asvetlov, yselivanov
2019-10-10 09:41:34Evgeny Nizhibitskysetmessageid: <1570700494.14.0.073826419802.issue38430@roundup.psfhosted.org>
2019-10-10 09:41:34Evgeny Nizhibitskylinkissue38430 messages
2019-10-10 09:41:34Evgeny Nizhibitskycreate