From f6c638c1e1494b2bce5fb104b160534772112991 Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Fri, 20 Aug 2021 18:10:51 +0200 Subject: [PATCH] Reduce amount of memory used after saving an Instance with the AnvilLoader --- src/main/java/net/minestom/server/instance/AnvilLoader.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/minestom/server/instance/AnvilLoader.java b/src/main/java/net/minestom/server/instance/AnvilLoader.java index 6a813afdb..2282cf57e 100644 --- a/src/main/java/net/minestom/server/instance/AnvilLoader.java +++ b/src/main/java/net/minestom/server/instance/AnvilLoader.java @@ -233,6 +233,7 @@ public class AnvilLoader implements IChunkLoader { try { LOGGER.debug("Attempt saving at {} {}", chunk.getChunkX(), chunk.getChunkZ()); mcaFile.writeColumn(column); + mcaFile.forget(column); } catch (IOException e) { LOGGER.error("Failed to save chunk " + chunkX + ", " + chunkZ, e); EXCEPTION_MANAGER.handleException(e);