summaryrefslogtreecommitdiffstats
path: root/Lib/concurrent
diff options
context:
space:
mode:
authorDave Chevell <chevell@gmail.com>2019-03-16 22:28:51 (GMT)
committerPablo Galindo <Pablogsal@gmail.com>2019-03-16 22:28:51 (GMT)
commit962bdeab191ee64459caa199209331005797ea7a (patch)
treead6c608742bcb8e5415b3a53f3e1fa6097abff59 /Lib/concurrent
parent9c68543f022b130ff51944edc6771c60510ee683 (diff)
downloadcpython-962bdeab191ee64459caa199209331005797ea7a.zip
cpython-962bdeab191ee64459caa199209331005797ea7a.tar.gz
cpython-962bdeab191ee64459caa199209331005797ea7a.tar.bz2
bpo-35715: Liberate return value of _process_worker (GH-11514)
ProcessPoolExecutor workers will hold 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 has been discarded by this point), the object can be safely released.
Diffstat (limited to 'Lib/concurrent')
-rw-r--r--Lib/concurrent/futures/process.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py
index ce7d642..9b85e7f 100644
--- a/Lib/concurrent/futures/process.py
+++ b/Lib/concurrent/futures/process.py
@@ -235,6 +235,7 @@ def _process_worker(call_queue, result_queue, initializer, initargs):
_sendback_result(result_queue, call_item.work_id, exception=exc)
else:
_sendback_result(result_queue, call_item.work_id, result=r)
+ del r
# Liberate the resource as soon as possible, to avoid holding onto
# open files or shared memory that is not needed anymore