Skip to content

MemoryManager ​

class · pocketmine\MemoryManager · source

Methods ​

__construct() ​

php
public function __construct(\pocketmine\Server $server)

canUseChunkCache() ​

php
public function canUseChunkCache() : bool

Deprecated

Deprecated.

check() ​

php
public function check() : void

Called every tick to update the memory manager state.

dumpMemory() ​

php
public static function dumpMemory(mixed $startingObject, string $outputFolder, int $maxNesting, int $maxStringSize, \Logger $logger) : void

Deprecated

Deprecated.

Static memory dumper accessible from any thread.

dumpServerMemory() ​

php
public function dumpServerMemory(string $outputFolder, int $maxNesting, int $maxStringSize) : void

Dumps the server memory into the specified output folder.

getGlobalMemoryLimit() ​

php
public function getGlobalMemoryLimit() : int

getViewDistance() ​

php
public function getViewDistance(int $distance) : int

Returns the allowed chunk radius based on the current memory usage.

isLowMemory() ​

php
public function isLowMemory() : bool

trigger() ​

php
public function trigger(int $memory, int $limit, bool $global = false, int $triggerCount = 0) : void

Triggers garbage collection and cache cleanup to try and free memory.

triggerGarbageCollector() ​

php
public function triggerGarbageCollector() : int

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.