diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 1d1e6362..23293543 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -21,6 +21,7 @@ package de.steamwar.bausystem; import com.comphenix.tinyprotocol.TinyProtocol; import de.steamwar.bausystem.configplayer.Config; +import de.steamwar.bausystem.features.world.RamUsage; import de.steamwar.bausystem.region.loader.PrototypeLoader; import de.steamwar.bausystem.region.loader.RegionLoader; import de.steamwar.bausystem.region.loader.Updater; @@ -73,6 +74,7 @@ public class BauSystem extends JavaPlugin implements Listener { new Updater(RegionLoader.file, RegionLoader::load); LinkageUtils.link(); + RamUsage.init(); // This could disable any watchdog stuff. We need to investigate if this is a problem. /* diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/RamUsage.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/RamUsage.java index a4451fda..6cf1600a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/RamUsage.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/RamUsage.java @@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.world; import lombok.experimental.UtilityClass; import java.io.*; +import java.util.concurrent.locks.LockSupport; @UtilityClass public class RamUsage { @@ -48,11 +49,8 @@ public class RamUsage { usage = _getUsage(); load = _getLoad(); - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } + Thread.yield(); + LockSupport.parkNanos(1000000000L); } }); thread.setDaemon(true);