mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2025-01-10 18:37:48 +01:00
0a19056af0
Fixes bad performance out of the box for production. Apparently there's another issue which is thinkering our minds up, it is that after certain amount of time the gc just can't keep up. We're investigating into this, but until it is fixed - this is gonna be a stable build Co-authored-by: Mykyta Komarn <nkomarn@hotmail.com>
32 lines
1.6 KiB
Diff
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 fc8d97262f39db62e1ea2cdd1d9c1df092175c63..b3e24d6f44320bf9b13f627dc5a9cb46614afe9b 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -1773,6 +1773,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) {
|