Problems with RAM

Discussion in 'Spigot Help' started by FortuneWorld, Mar 30, 2020.

  1. Hi everyone, I have some problems with RAM on the server and lags. According to React, memory is usually clogged by 30-50%, but every 2-3 minutes it grows to 98%+ and the server freezes for 15-20 seconds and kicks a large % of players, after which the memory returns to 30-50%. And this is repeated every 2-3 minutes. In timings, there is no load on TPS or anything, just shows that it seems to load EVERYTHING on the server.
     
  2. Might be Garbage Collection, see if you can switch to Java 11 (or higher) and switch to newer collector.

    Additionally how much RAM do you have allocated and are the parameters the same for the min and max?
     
  3. java -Xms1G -Xmx20G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -jar server.jar

    By the way, when I allocate all the memory the dedicated server stops holding.
    java -Xms20G -Xmx20G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -jar server.jar

    And when I allocate little memory, the server quickly crashes.
     
  4. How much RAM is installed? Also I would switch garbage collector if possible by upgrade to Java 11 or later and toggling that change in the params if required (Java 14 I believe does it by default).
     
  5. 64 GB ram
     
  6. This answers a part of your question. Don't load so much RAM into a single threaded instance, such as Minecraft. Minecraft wouldn't use 64GB even if you were to give it 300 plugins (unless the plugins are huge). You are making the garbage collector work harder for no reason. As for the amount of players, how many players are usually on? If it's 100+ maybe 32GB will suffice.