Memory Footprint: UUID Conversion

Saving RAM by clearing data after it's no longer needed by UUID
conversion code.
This commit is contained in:
ryanhamshire 2014-10-09 15:13:19 -07:00
parent 3ffb02e51e
commit e7b649810e
2 changed files with 7 additions and 1 deletions

View File

@ -109,6 +109,12 @@ public abstract class DataStore
this.saveClaim(claim); this.saveClaim(claim);
} }
//clean up any UUID conversion work
if(UUIDFetcher.lookupCache != null)
{
UUIDFetcher.lookupCache.clear();
}
GriefPrevention.AddLogEntry("Update finished."); GriefPrevention.AddLogEntry("Update finished.");
} }

View File

@ -26,7 +26,7 @@ class UUIDFetcher {
private final boolean rateLimiting; private final boolean rateLimiting;
//cache for username -> uuid lookups //cache for username -> uuid lookups
private static HashMap<String, UUID> lookupCache; static HashMap<String, UUID> lookupCache;
public UUIDFetcher(List<String> names, boolean rateLimiting) { public UUIDFetcher(List<String> names, boolean rateLimiting) {
this.names = names; this.names = names;