From bd5e1fbba925a02bea67f44bf7136b870d4e3a50 Mon Sep 17 00:00:00 2001 From: frymaster Date: Wed, 18 Dec 2013 09:29:51 +1100 Subject: [PATCH] Remove references to chunklist Commit c576054539790bdeb35285f62863d74b48c0782d removed the chunklist collection stored in ChunkProviderServer, however it has been partially restored in some places by 7e1ac0a77129b169704c1e222ff2deb3ab6cd2d2. As not all references to this were restored, this has caused the chunklist and chunks collections to become out of sync, resulting in a memory leak. --- .../0077-Remove-references-to-chunklist.patch | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 CraftBukkit-Patches/0077-Remove-references-to-chunklist.patch diff --git a/CraftBukkit-Patches/0077-Remove-references-to-chunklist.patch b/CraftBukkit-Patches/0077-Remove-references-to-chunklist.patch new file mode 100644 index 0000000000..46755ae155 --- /dev/null +++ b/CraftBukkit-Patches/0077-Remove-references-to-chunklist.patch @@ -0,0 +1,40 @@ +From b2430eeec08c1b17e83a32f509b045364f20bc11 Mon Sep 17 00:00:00 2001 +From: frymaster +Date: Tue, 17 Dec 2013 15:54:48 +0000 +Subject: [PATCH] Remove references to chunklist + +Commit c576054539790bdeb35285f62863d74b48c0782d removed the chunklist collection stored in ChunkProviderServer, however it has been partially restored in some places by 7e1ac0a77129b169704c1e222ff2deb3ab6cd2d2. As not all references to this were restored, this has caused the chunklist and chunks collections to become out of sync, resulting in a memory leak. + +This commit removes chunklist from ChunkProviderServer again. Fixes BUKKIT-5190 + +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index 88853ca..b88f75c 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -30,7 +30,6 @@ public class ChunkProviderServer implements IChunkProvider { + private IChunkLoader f; + public boolean forceChunkLoad = false; // true -> false + public LongObjectHashMap chunks = new LongObjectHashMap(); +- private List chunkList = new ArrayList(); + public WorldServer world; + // CraftBukkit end + +@@ -129,7 +128,6 @@ public class ChunkProviderServer implements IChunkProvider { + } + + this.chunks.put(LongHash.toLong(i, j), chunk); // CraftBukkit +- this.chunkList.add(chunk); + chunk.addEntities(); + + // CraftBukkit start +@@ -307,7 +305,6 @@ public class ChunkProviderServer implements IChunkProvider { + // this.unloadQueue.remove(olong); + // this.chunks.remove(olong.longValue()); + this.chunks.remove(chunkcoordinates); // CraftBukkit +- this.chunkList.remove(chunk); + } + } + // CraftBukkit end +-- +1.8.3.2 +