Skip to content

ResourceProfile 5.47.0 ​

enum · pocketmine\ResourceProfile · source

How the server trades memory and CPU for smoothness (performance-profile in server.properties).

Both profiles play exactly the same: same gameplay, mobs, terrain and view distance. They only differ in how much the server keeps in memory or prepares ahead of time:

  • PERFORMANCE (default) keeps chunks, workers and buffers around so that nothing has to be redone, and the main thread is rarely interrupted.
  • ECONOMY gives memory back sooner and keeps fewer helpers running, at the cost of a little more CPU (redoing things) and latency (new chunks generated by fewer workers, short write stalls during bursts of chunk saves).

The values here are defaults: a setting the owner changed in pocketmine.yml wins (see resolveInt()).

Cases ​

ECONOMY ​

php
case ECONOMY = "economy"

PERFORMANCE ​

php
case PERFORMANCE = "performance"

Methods ​

fromString() ​

php
public static function fromString(string $value) : ?self

Parses a performance-profile value: the profile names and their Spanish aliases (rendimiento, ahorro), any case. Returns null for anything else.

getAsyncWorkerIdleTimeout() ​

php
public function getAsyncWorkerIdleTimeout() : int

memory.async-worker-idle-timeout: seconds without tasks after which an async worker is shut down.

getAutoAsyncWorkerCount() ​

php
public function getAutoAsyncWorkerCount(int $usableCores) : int

Number of async workers of settings.async-workers "auto" for this many usable cores: cores - 2, at least 2 (one worker would run generation, lighting and chunk sending one after another), at most getMaxAutoAsyncWorkers().

getChunkGenerationWorkers() ​

php
public function getChunkGenerationWorkers() : int

chunk-generation.max-workers: async workers that generate chunks, each holding its own copy of the vanilla generator (~130 MB). Fewer means chunks far from the players arrive later, not different chunks.

getChunkUnloadDelay() ​

php
public function getChunkUnloadDelay() : int

Seconds a chunk nobody uses stays loaded before it is unloaded (a player coming back finds it loaded and the server does not read it from disk again).

getLevelDBWriteBufferSize() ​

php
public function getLevelDBWriteBufferSize() : int

LevelDB memtable size of each world, in bytes. A bigger one means fewer level-0 tables and no write throttling during bursts of chunk saves; it costs up to this much memory per world (twice while a full one is written).

getMaxAutoAsyncWorkers() ​

php
public function getMaxAutoAsyncWorkers() : int

Upper bound of settings.async-workers "auto" (still at most the usable cores - 2, at least 2).

getVanillagenGoGc() ​

php
public function getVanillagenGoGc() : ?int

GOGC of the vanillagen helper process (Go's default is 100: the heap may grow to twice the live data before a collection), or null to leave it to Go. A GOGC the owner set in the environment is always kept.

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.