Release memory to OS on garbage collection

ZMM often holds onto big chunks of memory after they aren't used anymore, which is fine in a webserver, but it's not OK for PM.
This commit is contained in:
Dylan K. Taylor
2020-09-09 01:40:18 +01:00
parent d2f1a3cf5b
commit d3ea29d527
2 changed files with 4 additions and 0 deletions

View File

@@ -25,11 +25,13 @@ namespace pocketmine\scheduler;
use function gc_collect_cycles;
use function gc_enable;
use function gc_mem_caches;
class GarbageCollectionTask extends AsyncTask{
public function onRun(){
gc_enable();
gc_collect_cycles();
gc_mem_caches();
}
}