From 5f7c8842555d28ed50c3f3b512078fd806725f5a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 6 Jun 2018 18:49:48 +0100 Subject: [PATCH] Reduce AsyncWorker default memory limit to 256MB a worker shouldn't be using as much memory as the main server thread would, so 1024MB is extremely excessive. --- src/pocketmine/Server.php | 2 +- src/pocketmine/resources/pocketmine.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 645dd7654..e2f035e76 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -1526,7 +1526,7 @@ class Server{ $poolSize = (int) $poolSize; } - $this->asyncPool = new AsyncPool($this, $poolSize, (int) max(-1, (int) $this->getProperty("memory.async-worker-hard-limit", 1024))); + $this->asyncPool = new AsyncPool($this, $poolSize, (int) max(-1, (int) $this->getProperty("memory.async-worker-hard-limit", 256))); if($this->getProperty("network.batch-threshold", 256) >= 0){ Network::$BATCH_THRESHOLD = (int) $this->getProperty("network.batch-threshold", 256); diff --git a/src/pocketmine/resources/pocketmine.yml b/src/pocketmine/resources/pocketmine.yml index 99cd38bd1..657c53aa7 100644 --- a/src/pocketmine/resources/pocketmine.yml +++ b/src/pocketmine/resources/pocketmine.yml @@ -40,7 +40,7 @@ memory: #AsyncWorker threads' hard memory limit in megabytes. Set to 0 to disable #This will crash the task currently executing on the worker if the task exceeds the limit #NOTE: THIS LIMIT APPLIES PER WORKER, NOT TO THE WHOLE PROCESS. - async-worker-hard-limit: 1024 + async-worker-hard-limit: 256 #Period in ticks to check memory (default 1 second) check-rate: 20