Yatopia/patches/server/0045-Fix-LightEngineThreaded-memory-leak.patch
Ivan Pekov f541b93c6a Updated Upstream and Sidestream(s) (Tuinity/Purpur/Rainforest)
Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Tuinity Changes:
76777f0 Updated Upstream (Paper)
6465aba Merge branch 'master' of https://github.com/Spottedleaf/Tuinity into ver/1.16.3
ba4dbb6 Do not allow ticket level changes while unloading playerchunks
e0e7144 Aggressive state checking in region manager

Purpur Changes:
0743d38 PaperPR - Add hex color code support for console logging
081f5a7 Oopsie, lets fix these snowballs :3
4895a88 Improve output of plugins command
3424c40 Minor changes to projectile despawn rate patch
9d49a31 Updated Upstream (Paper)
09e0103 add snowball to despawn rate config

Rainforest Changes:
5a187d6 Update to 1.16.3.
2020-09-20 21:45:23 +03:00

32 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ivan Pekov <ivan@mrivanplays.com>
Date: Thu, 10 Sep 2020 21:02:26 +0300
Subject: [PATCH] Fix LightEngineThreaded memory leak
diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java
index fd0beefb900c064d3c35a3d2f79f5b7d9c1287bb..4d024a4849b7566c0faba131caab57b4ddf35e29 100644
--- a/src/main/java/net/minecraft/server/LightEngineThreaded.java
+++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java
@@ -104,6 +104,8 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
}
}
+ public final void remove(long chunkId) { pendingTasks.removeIf(task -> task.chunkId == chunkId); queueUpdate(); } // Yatopia
+
public final boolean isEmpty() {
return this.size == 0 && this.pendingTasks.isEmpty();
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a21322ffd0bbb0c24b45cac9e2992c44d9c2977a..d53a9aa95c00b1ca7cf98fc88f49e3debff691a8 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1815,6 +1815,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
// Paper end
+ chunkProvider.getLightEngine().queue.remove(chunk.getPos().pair()); // Yatopia - unregister from light queue
}
public void unregisterEntity(Entity entity) {