From 306623e890b046cf195e57860d1043d99cf986fb Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 21 Dec 2024 17:47:16 +0000 Subject: [PATCH] FormatConverter: do periodic GC this reduces the risk of OOM during conversion of large worlds we probably ought to limit the size of region caches for regionized worlds, but that's a problem for another time. --- src/world/format/io/FormatConverter.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/world/format/io/FormatConverter.php b/src/world/format/io/FormatConverter.php index ea5af221c..421d707fa 100644 --- a/src/world/format/io/FormatConverter.php +++ b/src/world/format/io/FormatConverter.php @@ -153,6 +153,9 @@ class FormatConverter{ $this->logger->info("Converted $counter / $count chunks (" . floor($this->chunksPerProgressUpdate / $diff) . " chunks/sec)"); flush(); } + if(($counter % (2 ** 16)) === 0){ + $new->doGarbageCollection(); + } } $total = microtime(true) - $start; $this->logger->info("Converted $counter / $counter chunks in " . round($total, 3) . " seconds (" . floor($counter / $total) . " chunks/sec)");