From 191a19a0a44b0fa4c41f49be70e0f83b64fd1f2c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 15 Jan 2024 17:15:58 +0100 Subject: [PATCH] wip #6629 --- src/PHP.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PHP.php b/src/PHP.php index 7c8f562..b3d5ccd 100644 --- a/src/PHP.php +++ b/src/PHP.php @@ -22,9 +22,9 @@ class PHP ini_set("memory_limit", $amount); } - public static function isCloseToMemoryLimit($throw = false) + public static function isCloseToMemoryLimit($throw = false, $ratio = 0.9) { - $res = (memory_get_usage() / Math::toBytes(ini_get('memory_limit'))) > 0.9; + $res = (memory_get_usage() / Math::toBytes(ini_get('memory_limit'))) > $ratio; if ($throw && $res) { throw new \Exception('Memory is close to the limit'); } -- 2.39.5