Skip to content

Commit

Permalink
change memory limit
Browse files Browse the repository at this point in the history
  • Loading branch information
GlazerMann authored Feb 4, 2024
1 parent e206fe9 commit f9d3884
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions expandFns.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit f9d3884

Please sign in to comment.