mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-22 16:09:16 +00:00
Sync
This commit is contained in:
@@ -471,21 +471,18 @@ public class Mantle {
|
|||||||
try {
|
try {
|
||||||
Iris.debug("Trimming Tectonic Plates older than " + Form.duration(adjustedIdleDuration.get(), 0));
|
Iris.debug("Trimming Tectonic Plates older than " + Form.duration(adjustedIdleDuration.get(), 0));
|
||||||
if (lastUse != null) {
|
if (lastUse != null) {
|
||||||
synchronized (lastUse) { // Synchronize access to lastUse ( GPT Code )
|
for (Long i : new ArrayList<>(lastUse.keySet())) {
|
||||||
for (Long i : new ArrayList<>(lastUse.keySet())) { // Use ArrayList to avoid ConcurrentModificationException
|
|
||||||
double finalAdjustedIdleDuration = adjustedIdleDuration.get();
|
double finalAdjustedIdleDuration = adjustedIdleDuration.get();
|
||||||
hyperLock.withLong(i, () -> {
|
hyperLock.withLong(i, () -> {
|
||||||
Long lastUseTime = lastUse.get(i); // Move the get inside the lock
|
Long lastUseTime = lastUse.get(i);
|
||||||
if (lastUseTime != null && M.ms() - lastUseTime >= finalAdjustedIdleDuration) {
|
if (lastUseTime != null && M.ms() - lastUseTime >= finalAdjustedIdleDuration) {
|
||||||
toUnload.add(i);
|
toUnload.add(i);
|
||||||
Iris.debug("Tectonic Region added to unload");
|
Iris.debug("Tectonic Region added to unload");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (IrisSettings.get().getPerformance().AggressiveTectonicUnload
|
if (IrisSettings.get().getPerformance().AggressiveTectonicUnload
|
||||||
&& loadedRegions.size() > forceAggressiveThreshold.get()) {
|
&& loadedRegions.size() > forceAggressiveThreshold.get()) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user