mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
Disable memory limit before performing a mem dump
Fix memory dumps not completing due to exhausting available memory
This commit is contained in:
@@ -214,6 +214,8 @@ class MemoryManager{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function dumpServerMemory($outputFolder, $maxNesting, $maxStringSize){
|
public function dumpServerMemory($outputFolder, $maxNesting, $maxStringSize){
|
||||||
|
$hardLimit = ini_get('memory_limit');
|
||||||
|
ini_set('memory_limit', -1);
|
||||||
gc_disable();
|
gc_disable();
|
||||||
|
|
||||||
if(!file_exists($outputFolder)){
|
if(!file_exists($outputFolder)){
|
||||||
@@ -300,6 +302,7 @@ class MemoryManager{
|
|||||||
|
|
||||||
echo "[Dump] Finished!\n";
|
echo "[Dump] Finished!\n";
|
||||||
|
|
||||||
|
ini_set('memory_limit', $hardLimit);
|
||||||
gc_enable();
|
gc_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user