[issue37909] Thread pool return ref hold memory

2020-01-21 Thread Andrew Svetlov
Andrew Svetlov added the comment: The latest example releases allocated python objects. The memory is returned to allocator which, in turn, can hold it for a while. The allocator is not controlled by Python API. Anyway, if an explicit executor solves your needs -- please just use it.

[issue37909] Thread pool return ref hold memory

2020-01-21 Thread Anders
Anders added the comment: Note: due to a change in Python 3.8 this example would be a lot less noticeable if tested. The problem remains the same though. If you run this snippet with Python 3.7, which is before the thread reuse was introduced into the ThreadPoolExecutor, each thread will

[issue37909] Thread pool return ref hold memory

2019-09-09 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue37909] Thread pool return ref hold memory

2019-08-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: In asyncio code please use non-blocking code and await a future returned by run_until_complete. The following code doesn't leak: import asyncio import concurrent import threading def prepare_a_giant_list(): m = [] for i in range(1000*1000):

[issue37909] Thread pool return ref hold memory

2019-08-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37909] Thread pool return ref hold memory

2019-08-21 Thread Tianshu Gao
New submission from Tianshu Gao : This is very similar to issue35715. But this is happen for thread. After the func in thread finished, the memory is still hold and accumulate. import asyncio import time import concurrent import threading loop = asyncio.get_event_loop() def