From f9d38840fef622630da816ed2e2ad5eaecfe9002 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Sun, 4 Feb 2024 11:30:43 -0600 Subject: [PATCH] change memory limit --- expandFns.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/expandFns.php b/expandFns.php index 9b437c905f..6962e93a6a 100644 --- a/expandFns.php +++ b/expandFns.php @@ -975,7 +975,7 @@ function throttle () : void { $mem_max = (string) @ini_get('memory_limit'); if (preg_match('~^(\d+)M$~', $mem_max, $matches)) { $mem_used = memory_get_usage() / (1024*1024); - $mem_max = 0.9 * @intval($matches[1]); + $mem_max = 0.8 * @intval($matches[1]); if ($mem_max !== 0 && ($mem_used > $mem_max)) { // Clear every buffer we have /** @psalm-suppress UnusedFunctionCall */ @strtok('',''); // This should do nothing @@ -987,7 +987,9 @@ function throttle () : void { $mem_used = (string) $mem_used; bot_debug_log("Cleared memory: " . $mem_used2 . ' : ' . $mem_used1 . ' : ' . $mem_used); } - } + } else { + bot_debug_log("Memory Limit should end in M, but got: " . echoable($mem_max)); + } $phase = $phase + 1; if ($phase < $cycles) { return;