Adding to usage list before to hashmap for better concurrency.
This commit is contained in:
parent
50ee956ce7
commit
0eb2a13d14
@ -35,8 +35,8 @@ public class Cache<K, V> {
|
||||
CacheValue<K, V> 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);
|
||||
}
|
||||
|
1
test-server/start_normal_ram+.ps1
Normal file
1
test-server/start_normal_ram+.ps1
Normal file
@ -0,0 +1 @@
|
||||
Start-Process java -ArgumentList "-Xms512M", "-Xmx4G", "-jar", "paper-195.jar", "nogui"
|
Loading…
Reference in New Issue
Block a user