From 0eb2a13d1451bb6247d1d660226f67a142cbbb65 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 30 Apr 2020 14:53:48 -0500 Subject: [PATCH] Adding to usage list before to hashmap for better concurrency. --- src/main/java/ca/recrown/islandsurvivalcraft/caching/Cache.java | 2 +- test-server/start_normal_ram+.ps1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 test-server/start_normal_ram+.ps1 diff --git a/src/main/java/ca/recrown/islandsurvivalcraft/caching/Cache.java b/src/main/java/ca/recrown/islandsurvivalcraft/caching/Cache.java index 1129d42..63455fe 100644 --- a/src/main/java/ca/recrown/islandsurvivalcraft/caching/Cache.java +++ b/src/main/java/ca/recrown/islandsurvivalcraft/caching/Cache.java @@ -35,8 +35,8 @@ public class Cache { CacheValue val = new CacheValue<>(); val.key = key; val.value = value; - data.put(key, val); usage.add(val); + data.put(key, val); if (data.size() > maxSize) { data.remove(usage.pop().key); } diff --git a/test-server/start_normal_ram+.ps1 b/test-server/start_normal_ram+.ps1 new file mode 100644 index 0000000..dd26164 --- /dev/null +++ b/test-server/start_normal_ram+.ps1 @@ -0,0 +1 @@ +Start-Process java -ArgumentList "-Xms512M", "-Xmx4G", "-jar", "paper-195.jar", "nogui" \ No newline at end of file