I have a Minecraft server (1.16.4) and having trouble with RAM usage causing my server to suddenly stop working. I have 8GB RAM and my server runs on Linux and when I start the server, my ram is 3GB, but when someone joins (around 3-5 players) the RAM usage increases until it reaches 8GB ram, and after it reaches 8GB my server suddenly stopped working and I can't stop or restart the server because my console also freezes.
Before it reach 8GB ram, the server was at 20 TPS but after ram reach 8GB, my server suddenly dropped its TPS, but I don't know it because of my plugins or memory leaking.
- with 3 to 5 player my ram is (3GB/8GB)
- after playing for 1 hour my ram hit 8GB ram (7.89GB/8GB)
my server Startup Settings:
java -Xms8000M -Xmx8000M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs/ -Daikars.new.flags=true -jar server.jar nogui
this server is running on Pterodactyl Panel.
Plugins (62):
AdvancedEnchantments, AdvancedRegionMarket, AltDetector, AnimatedScoreboard, AutomaticBroadcast, AutoPluginLoader, BungeeTabListPlus, Citizens, ClearLag, ClearLagTimer*, ColoredSigns*, CommandPanels, CoreProtect, DeluxeMentions, DiscordSRV, Essentials, EssentialsAntiBuild, EssentialsChat, EssentialsGeoIP, EssentialsProtect, EssentialsSpawn, FastChunkPregenerator, FogusCore, GoldenCrates, GoldenEnchants, GSit, Harbor, HolographicDisplays, ImageMaps, Jobs, LuckPerms, LWC, mcMMO, Minepacks, MMOItems, MMOLib, Multiverse-Core, NexEngine, OpenInv, PlaceholderAPI, PlayTime*, Playtimes*, ProtocolLib, QuantumShop, Quests, RandomTeleport, SilkSpawners, Towny, TownyChat, TownyNameUpdater, UltimateAutoRestart, UnlimitedEnchants, Vault, ViaBackwards, ViaRewind, ViaVersion, Votifier, VotingPlugin, WorldEdit, WorldGuard, WorldGuard-Towny*, WorldGuardExtraFlags
What's causing my server to do this?
-Xms
and-Xmx
flags are set to5000M
, or lower values? As soon as it reaches maximum memory, it freezes?