mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Foundational work for Future Memory usage improvements
This commit doesn't do much on its own, but adds a new Java Cleaner API that lets us hook into Garbage Collector events to reclaim pooled objects and return them to the pool. Adds framework for Network Packets to know when a packet has finished dispatching to get an idea when a packet is done sending to players. Rewrites PooledObjects impl to properly respect max pool size and remove almost all risk of contention. Bumps the Paper Async Task Queue to use 2 threads, and properly shuts it down on shutdown.
This commit is contained in:
@@ -1587,11 +1587,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // apply fixes
|
||||
+
|
||||
+ try {
|
||||
+ if (chunkData.poiData != null) {
|
||||
+ chunkData.poiData = chunkData.poiData.clone(); // clone data for safety, file IO thread does not clone
|
||||
+ }
|
||||
+ chunkData.chunkData = chunkManager.getChunkData(this.world.getWorldProvider().getDimensionManager(),
|
||||
+ chunkManager.getWorldPersistentDataSupplier(), chunkData.chunkData.clone(), chunkPos, this.world); // clone data for safety, file IO thread does not clone
|
||||
+ chunkManager.getWorldPersistentDataSupplier(), chunkData.chunkData, chunkPos, this.world); // clone data for safety, file IO thread does not clone
|
||||
+ } catch (final Throwable ex) {
|
||||
+ PaperFileIOThread.LOGGER.error("Could not apply datafixers for chunk task: " + this.toString(), ex);
|
||||
+ this.complete(ChunkLoadTask.createEmptyHolder());
|
||||
|
Reference in New Issue
Block a user