From 59edea5721e5674a2e15c02420ebb55d1ee9caa1 Mon Sep 17 00:00:00 2001 From: Sebastian Jennen Date: Mon, 9 Dec 2024 09:47:17 +0100 Subject: [PATCH] Pool.php - add methods to clear finished/results cache (#235) Since the member variables of finished/results keep growing indefinitely over time this is a source of a memory leak. This memory leak is resolvable by clearing the result caches with the newly introduced methods. --- src/Pool.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Pool.php b/src/Pool.php index e886368..438899e 100644 --- a/src/Pool.php +++ b/src/Pool.php @@ -367,4 +367,15 @@ public function stop() { $this->stopped = true; } + + public function clearFinished() + { + $this->finished = []; + } + + public function clearResults() + { + $this->results = []; + } + }