mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 12:04:46 +00:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user