mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
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:
parent
cb1f733303
commit
db9534bfdf
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user