You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-03-16.22:29:06.895>created_at=<Date2019-01-11.08:36:21.237>labels= ['3.8', 'library']
title='ProcessPool workers hold onto return value of last task in memory'updated_at=<Date2019-03-16.22:29:06.894>user='https://github.com/dchevell'
ProcessPoolExecutor workers will hold onto the return value of their last task in memory until the next task is received. Since the return value has already been propagated to the parent process's Future or else effectively discarded, this is holding onto objects unnecessarily.
Simple case to reproduce:
importconcurrent.futuresimporttimeexecutor=concurrent.futures.ProcessPoolExecutor(max_workers=1)
defbig_val():
return [{1:1} foriinrange(1, 1000000)]
executor.submit(big_val)
# Observe the memory usage of the process worker during the sleep intervaltime.sleep(10)
This should be easily fixed by having the worker explicitly del r after calling _sendback_result as it already does this for call_item
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: