Fix memory leak in proto chunk change
This commit is contained in:
parent
9a17bddf12
commit
433c56c2d3
|
@ -1,4 +1,4 @@
|
||||||
From 2d53aa2c84c4fed063659a26e9bcb90d546a5ae8 Mon Sep 17 00:00:00 2001
|
From 114ef33e651ac74cef786afa84ff16003b0cccfb Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Sun, 22 Jul 2018 21:21:41 -0400
|
Date: Sun, 22 Jul 2018 21:21:41 -0400
|
||||||
Subject: [PATCH] Don't save Proto Chunks
|
Subject: [PATCH] Don't save Proto Chunks
|
||||||
|
@ -7,30 +7,8 @@ These chunks are unfinished, and waste cpu time saving these unfinished chunks.
|
||||||
the loadChunk method refuses to acknoledge they exists, and will restart
|
the loadChunk method refuses to acknoledge they exists, and will restart
|
||||||
a new chunk generation process to begin with, so saving them serves no benefit.
|
a new chunk generation process to begin with, so saving them serves no benefit.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
||||||
index fd8430a68f..b425704b1a 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
||||||
@@ -250,7 +250,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
|
||||||
public boolean a(boolean flag) {
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
- this.f.a();
|
|
||||||
+ //this.f.a(); // Paper - don't save proto chunks
|
|
||||||
ArrayList arraylist = Lists.newArrayList(this.chunks.values());
|
|
||||||
Iterator iterator = arraylist.iterator();
|
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
- this.f.a();
|
|
||||||
+ //this.f.a(); // Paper - don't save proto chunks
|
|
||||||
this.chunkLoader.b();
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||||
index ea8684747d..a97e024ec4 100644
|
index ea8684747..a97e024ec 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||||
@@ -282,6 +282,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
@@ -282,6 +282,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||||
|
@ -41,6 +19,19 @@ index ea8684747d..a97e024ec4 100644
|
||||||
// Spigot end
|
// Spigot end
|
||||||
world.checkSession();
|
world.checkSession();
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
||||||
|
index 501565dd5..7b3068753 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
||||||
|
@@ -23,7 +23,7 @@ public class ChunkTaskScheduler extends Scheduler<ChunkCoordIntPair, ChunkStatus
|
||||||
|
protected boolean a(Scheduler.a scheduler_a) {
|
||||||
|
ProtoChunk protochunk = (ProtoChunk) scheduler_a.a();
|
||||||
|
|
||||||
|
- return !protochunk.ab_() && !protochunk.h();
|
||||||
|
+ return !protochunk.ab_() /*&& !protochunk.h()*/; // Paper
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
--
|
--
|
||||||
2.18.0
|
2.18.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue