diff --git a/Spigot-Server-Patches/0372-Fix-major-memory-leaks-in-ExpiringMap.patch b/Spigot-Server-Patches/0372-Fix-major-memory-leaks-in-ExpiringMap.patch index 5e81011ffa..e2e77b3364 100644 --- a/Spigot-Server-Patches/0372-Fix-major-memory-leaks-in-ExpiringMap.patch +++ b/Spigot-Server-Patches/0372-Fix-major-memory-leaks-in-ExpiringMap.patch @@ -1,4 +1,4 @@ -From c9297fde1beff53e303bb09caf0bb4b20c6792ce Mon Sep 17 00:00:00 2001 +From 9a08afb634666123c7181b6d7b26052c4b423588 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 16 Sep 2018 00:00:16 -0400 Subject: [PATCH] Fix major memory leaks in ExpiringMap @@ -11,7 +11,7 @@ not run on every manipulation, and instead to run clean once per tick per expiring map. diff --git a/src/main/java/net/minecraft/server/ExpiringMap.java b/src/main/java/net/minecraft/server/ExpiringMap.java -index 4006f5a69c..5345b97241 100644 +index 4006f5a69c..3b90f6e6c3 100644 --- a/src/main/java/net/minecraft/server/ExpiringMap.java +++ b/src/main/java/net/minecraft/server/ExpiringMap.java @@ -6,25 +6,44 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; @@ -72,9 +72,9 @@ index 4006f5a69c..5345b97241 100644 } } - -+ if (this.ttl.size() != this.size) { ++ if (this.ttl.size() != this.size()) { + MinecraftServer.LOGGER.error("WARNING: ExpiringMap desync - Memory leak risk!"); -+ for (Entry entry : this.entries) { ++ for (Entry entry : this.long2ObjectEntrySet()) { + ttl.putIfAbsent(entry.getLongKey(), now); + } + }