mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
AsyncPool: Slightly reduce worker memory usage with more conservative start options
this results in a memory footprint reduction of maybe 4MB for a total of 8 workers. Not much, but it's something.
This commit is contained in:
@ -26,6 +26,7 @@ namespace pocketmine\scheduler;
|
||||
use pocketmine\Server;
|
||||
|
||||
class AsyncPool{
|
||||
private const WORKER_START_OPTIONS = PTHREADS_INHERIT_INI | PTHREADS_INHERIT_CONSTANTS;
|
||||
|
||||
/** @var Server */
|
||||
private $server;
|
||||
@ -62,7 +63,7 @@ class AsyncPool{
|
||||
$this->workerUsage[$i] = 0;
|
||||
$this->workers[$i] = new AsyncWorker($this->logger, $i + 1, $this->workerMemoryLimit);
|
||||
$this->workers[$i]->setClassLoader($this->classLoader);
|
||||
$this->workers[$i]->start();
|
||||
$this->workers[$i]->start(self::WORKER_START_OPTIONS);
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +77,7 @@ class AsyncPool{
|
||||
$this->workerUsage[$i] = 0;
|
||||
$this->workers[$i] = new AsyncWorker($this->logger, $i + 1, $this->workerMemoryLimit);
|
||||
$this->workers[$i]->setClassLoader($this->classLoader);
|
||||
$this->workers[$i]->start();
|
||||
$this->workers[$i]->start(self::WORKER_START_OPTIONS);
|
||||
}
|
||||
$this->size = $newSize;
|
||||
}
|
||||
|
Reference in New Issue
Block a user