From 74f78b8b886f012da6a460dbd7e479c8d38b0bbb Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 20 Jan 2014 13:50:37 +1100 Subject: [PATCH] Reduce memory of hiddenPlayers map. --- ...8-Reduce-memory-of-hiddenPlayers-map.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 CraftBukkit-Patches/0098-Reduce-memory-of-hiddenPlayers-map.patch diff --git a/CraftBukkit-Patches/0098-Reduce-memory-of-hiddenPlayers-map.patch b/CraftBukkit-Patches/0098-Reduce-memory-of-hiddenPlayers-map.patch new file mode 100644 index 0000000000..dc218756e1 --- /dev/null +++ b/CraftBukkit-Patches/0098-Reduce-memory-of-hiddenPlayers-map.patch @@ -0,0 +1,22 @@ +From d5146fda6fe149caae4696f8d59ed8a24dfdc7f5 Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Mon, 20 Jan 2014 13:50:32 +1100 +Subject: [PATCH] Reduce memory of hiddenPlayers map. + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 331ff29..fe63ebd 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -62,7 +62,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + private boolean hasPlayedBefore = false; + private final ConversationTracker conversationTracker = new ConversationTracker(); + private final Set channels = new HashSet(); +- private final Map hiddenPlayers = new MapMaker().softValues().makeMap(); ++ private final Map hiddenPlayers = new MapMaker().weakValues().makeMap(); // Spigot - soft -> weak + private int hash = 0; + private double health = 20; + private boolean scaledHealth = false; +-- +1.8.3.2 +