From bd8cc3d73834e24e4c835d954d1b0ef179d6b6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Fern=C3=A1ndez?= Date: Sun, 28 May 2017 03:26:03 +0200 Subject: [PATCH] Improve memory usage at Query/Builder/chunkById (#19369) * Improve the usage of memory * StyleCI * StyleCI --- src/Illuminate/Database/Query/Builder.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index c41bf1ff7804..4fa473b99172 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -1863,6 +1863,8 @@ public function chunkById($count, callable $callback, $column = 'id', $alias = n } $lastId = $results->last()->{$alias}; + + unset($results); } while ($countResults == $count); return true;