From 9d9909cf10bc31b625d22b62d0b6a682d32f45c9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 29 Apr 2017 17:45:09 +0000 Subject: [PATCH] Some more places were we check now --- boot.php | 4 ++++ include/poller.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/boot.php b/boot.php index d8b9cbf241..99af7d3778 100644 --- a/boot.php +++ b/boot.php @@ -1420,6 +1420,10 @@ class App { $cmdline = implode($args, " "); + if ($this->min_memory_reached()) { + return; + } + if (get_config('system', 'proc_windows')) { $resource = proc_open('cmd /c start /b ' . $cmdline, array(), $foo, dirname(__FILE__)); } else { diff --git a/include/poller.php b/include/poller.php index 9641819885..8f9f5aa24d 100644 --- a/include/poller.php +++ b/include/poller.php @@ -71,6 +71,11 @@ function poller_run($argv, $argc){ while ($r = poller_worker_process()) { + // Check free memory + if ($a->min_memory_reached()) { + return; + } + // Count active workers and compare them with a maximum value that depends on the load if (poller_too_much_workers()) { return; -- 2.39.5