One more to seal the deal to improve unloading inactive chunks

While last was mostly there, still had some slight risk of unloading
before it was fully finished.

So just going to bump the delay to 3 minutes to be safe. Better than
forever at least.

Was really hoping we could unload them as soon as they were done to
any memory prematurely promoting to old generation, but guess we can't.
This commit is contained in:
Aikar 2020-05-25 13:09:56 -04:00
parent cb1f733303
commit db9534bfdf

View File

@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - remove inaccessible chunks leaked
+ else if (playerchunk.getTicketLevel() == playerchunk.oldTicketLevel &&
+ playerChunkMap.unloadQueue.size() < 100 &&
+ (playerchunk.lastActivity == 0 || world.getTime() - playerchunk.lastActivity > 20*15) &&
+ (playerchunk.lastActivity == 0 || world.getTime() - playerchunk.lastActivity > 20*180) &&
+ PlayerChunk.getChunkState(playerchunk.getTicketLevel()) == PlayerChunk.State.INACCESSIBLE
+ ) {
+ ChunkStatus chunkHolderStatus = playerchunk.getChunkHolderStatus();
@ -87,6 +87,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ChunkStatus chunkstatus = (ChunkStatus) intfunction.apply(j1);
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = playerchunk.a(chunkstatus, this);
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (requestingNeighbor != null && requestingNeighbor != playerchunk && !completablefuture.isDone()) {
requestingNeighbor.onNeighborRequest(playerchunk, chunkstatus);
completablefuture.thenAccept(either -> {
+ playerchunk.lastActivity = world.getTime(); // Paper - chunk leak
requestingNeighbor.onNeighborDone(playerchunk, chunkstatus, either.left().orElse(null));
});
}
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
while (longiterator.hasNext()) { // Spigot
long j = longiterator.nextLong();