PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
pocketmine\MemoryManager Class Reference
+ Collaboration diagram for pocketmine\MemoryManager:

Public Member Functions

 __construct (private Server $server)
 
 canUseChunkCache ()
 
 check ()
 
 dumpServerMemory (string $outputFolder, int $maxNesting, int $maxStringSize)
 
 getGlobalMemoryLimit ()
 
 getViewDistance (int $distance)
 
 isLowMemory ()
 
 trigger (int $memory, int $limit, bool $global=false, int $triggerCount=0)
 
 triggerGarbageCollector ()
 

Static Public Member Functions

static dumpMemory (mixed $startingObject, string $outputFolder, int $maxNesting, int $maxStringSize, \Logger $logger)
 

Detailed Description

Definition at line 73 of file MemoryManager.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\MemoryManager::__construct ( private Server $server)

Definition at line 104 of file MemoryManager.php.

Member Function Documentation

◆ canUseChunkCache()

pocketmine\MemoryManager::canUseChunkCache ( )

Definition at line 166 of file MemoryManager.php.

◆ check()

pocketmine\MemoryManager::check ( )

Called every tick to update the memory manager state.

Definition at line 210 of file MemoryManager.php.

◆ dumpMemory()

static pocketmine\MemoryManager::dumpMemory ( mixed $startingObject,
string $outputFolder,
int $maxNesting,
int $maxStringSize,
\Logger $logger )
static

Static memory dumper accessible from any thread.

Definition at line 287 of file MemoryManager.php.

◆ dumpServerMemory()

pocketmine\MemoryManager::dumpServerMemory ( string $outputFolder,
int $maxNesting,
int $maxStringSize )

Dumps the server memory into the specified output folder.

Definition at line 271 of file MemoryManager.php.

References pocketmine\server().

+ Here is the call graph for this function:

◆ getGlobalMemoryLimit()

pocketmine\MemoryManager::getGlobalMemoryLimit ( )

Definition at line 162 of file MemoryManager.php.

◆ getViewDistance()

pocketmine\MemoryManager::getViewDistance ( int $distance)

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

Definition at line 173 of file MemoryManager.php.

◆ isLowMemory()

pocketmine\MemoryManager::isLowMemory ( )

Definition at line 158 of file MemoryManager.php.

◆ trigger()

pocketmine\MemoryManager::trigger ( int $memory,
int $limit,
bool $global = false,
int $triggerCount = 0 )

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

Definition at line 180 of file MemoryManager.php.

References pocketmine\server().

+ Here is the call graph for this function:

◆ triggerGarbageCollector()

pocketmine\MemoryManager::triggerGarbageCollector ( )

Definition at line 247 of file MemoryManager.php.


The documentation for this class was generated from the following file: