Memory leak in all servers on pterodactyl 1.11.7

I'm having a memory leak on all servers on my node. Memory just keeps building up, both in btop and the pterodactyl panel and it never goes back down. It just keeps increasing until an eventual crash. I've allocated an extra GB of RAM on top of my overhead to just slow down the crashes but that is a bandaid. Please help. GC log attached and here are my flags for my SMP:
java -Xms7680M -Xmx7680M --add-modules=jdk.incubator.vector -XX:+UseG1GC -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -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 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar --nogui
java -Xms7680M -Xmx7680M --add-modules=jdk.incubator.vector -XX:+UseG1GC -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -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 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar --nogui
I've allocated 10GB of RAM just to keep it from crashing. The proxy server is more detrimental because when it crashes, well you know what happens. RIP all those new players. Here are the flags for that:
java -Xms128M -Xmx1024M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=50 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AlwaysPreTouch -XX:G1HeapRegionSize=16M -XX:MaxRAMPercentage=75 -jar server.jar
java -Xms128M -Xmx1024M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=50 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AlwaysPreTouch -XX:G1HeapRegionSize=16M -XX:MaxRAMPercentage=75 -jar server.jar
As you can see I've been experimenting with removing/adding -XX:+AlwaysPreTouch but it doesn't seem to make a difference. Spark report for the SMP: https://spark.lucko.me/MuOCMTpVyn @Jared | InfraCharm Skullian told me to ping you (sorry)
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
54 Replies
Admincraft Meta
Admincraft Meta5mo ago
Spark Profile Analysis
These are not magic values. Many of these settings have real consequences on your server's mechanics. See this guide for detailed information on the functionality of each setting.
✅ Your server isn't lagging
Your server is running fine with an average TPS of 20.
Requested by torrentstaff • Page 1 of 4
Admincraft Meta
Admincraft Meta5mo ago
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by torrentstaff#0
Torrent
TorrentOP5mo ago
lavaking46
lavaking465mo ago
Your number of entities is very large
ProGamingDk
ProGamingDk5mo ago
Everything looks just fine memory wise
lavaking46
lavaking465mo ago
agreed
Torrent
TorrentOP5mo ago
yeah that's definitely something I need to watch out for, but doesn't explain why memory just keeps building up and never gets cleared that's my damn problem; can't identify what the fuck is causing this to happen like afaik, a proxy server should not need 2+ GB to function with a small player count and the memory usage should go up and down, not just go up and up and up and up
ProGamingDk
ProGamingDk5mo ago
No Panel can only see and act on whatd allocated Nvm
Torrent
TorrentOP5mo ago
... it is not normal for memory to keep increasing until it crashes i could increase the allocation to 20GB on the SMP, it would still keep building up and then crash Xmx is set to 7.5GB
ProGamingDk
ProGamingDk5mo ago
Shouldnt go that far, whats have you allocated currently
Torrent
TorrentOP5mo ago
I had it on 1.5GB overhead; which is recommended and works for most situations afaik, but it kept crashing, so now the allocation is 2.5GB higher than Xmx so 7.5 -> 10 it is currently at 8.45 but i guarantee it will increase past 9 within like 30-45 minutes I NEED to get this sorted so I can have 1.5GB overhead for each server max, and like 500MB for the proxies
ProGamingDk
ProGamingDk5mo ago
There is something called native memory spark cant see and gc doesnt touch, but its done by plugins and dont know how to check or troubleshoot
Jared | InfraCharm
It's your GC, it's taking 14.5 seconds to run causing MSPT to drop.
Torrent
TorrentOP5mo ago
Is there something I can do with the flags to fix that?
Jared | InfraCharm
Yes
Torrent
TorrentOP5mo ago
I am all ears for any recommendation. I've tried every set of flags out there; etil's, shenendoah, etc
Jared | InfraCharm
Add -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M to your startup flags. Send me the gc.log that gets generated after 15 mins along with a new 15m spark report I'll send you an optimized set of flags Aikars is trash
Torrent
TorrentOP5mo ago
ok I have that flag on the SMP already, I will generate a new spark shall I do that for all servers or can you make do with one?
Jared | InfraCharm
Each server will need its own set of optimizations.
Torrent
TorrentOP5mo ago
ok bear with me, thank you
Torrent
TorrentOP5mo ago
@Jared | InfraCharm spark report for SMP: https://spark.lucko.me/e06FHyNGQj
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta5mo ago
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
Requested by torrentstaff
Admincraft Meta
Admincraft Meta5mo ago
Spark Profile Analysis
These are not magic values. Many of these settings have real consequences on your server's mechanics. See this guide for detailed information on the functionality of each setting.
✅ Your server isn't lagging
Your server is running fine with an average TPS of 20.
Requested by torrentstaff • Page 1 of 4
Jared | InfraCharm
What are your startup flags
Torrent
TorrentOP5mo ago
java -Xms7680M -Xmx7680M --add-modules=jdk.incubator.vector -XX:+UseG1GC -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -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 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar --nogui
java -Xms7680M -Xmx7680M --add-modules=jdk.incubator.vector -XX:+UseG1GC -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -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 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar --nogui
Jared | InfraCharm
Great, and what are your panel container settings for this server? Like memory, threads, stuff like that
Torrent
TorrentOP5mo ago
No description
Torrent
TorrentOP5mo ago
Java 21 Pufferfish 1.21 build 7
Torrent
TorrentOP5mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta5mo ago
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
Requested by torrentstaff
Admincraft Meta
Admincraft Meta5mo ago
Spark Profile Analysis
These are not magic values. Many of these settings have real consequences on your server's mechanics. See this guide for detailed information on the functionality of each setting.
✅ Your server isn't lagging
Your server is running fine with an average TPS of 20.
Requested by torrentstaff • Page 1 of 4
Jared | InfraCharm
java -Xms7G -Xmx8G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=10 -XX:ConcGCThreads=3 -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -XX:+UnlockExperimentalVMOptions -XX:G1HeapRegionSize=16M -XX:G1NewSizePercent=20 -XX:G1MaxNewSizePercent=60 -XX:InitiatingHeapOccupancyPercent=30 -XX:G1MixedGCLiveThresholdPercent=85 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Duser.language=en
java -Xms7G -Xmx8G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=10 -XX:ConcGCThreads=3 -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -XX:+UnlockExperimentalVMOptions -XX:G1HeapRegionSize=16M -XX:G1NewSizePercent=20 -XX:G1MaxNewSizePercent=60 -XX:InitiatingHeapOccupancyPercent=30 -XX:G1MixedGCLiveThresholdPercent=85 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Duser.language=en
For SMP. If a flag does not allow your server to start, remove the flag and let me know which one it was so we can substitute it. Send me a new gc.log and spark report in 60 minutes Startup flags
Torrent
TorrentOP5mo ago
java -Xms6656M -Xmx6656M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -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 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -jar server.jar --nogui
Jared | InfraCharm
and container settings
Torrent
TorrentOP5mo ago
No description
Admincraft Meta
Admincraft Meta5mo ago
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
Requested by torrentstaff
Torrent
TorrentOP5mo ago
oh i missed something lol I forgot to add the jar file am an idiot it's starting
Jared | InfraCharm
java -Xms7G -Xmx7G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch -XX:+UseLargePages -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=85 -XX:+AggressiveOpts -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch -XX:+UseLargePages -XX:+DisableExplicitGC -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -jar server.jar nogui
java -Xms7G -Xmx7G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch -XX:+UseLargePages -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=85 -XX:+AggressiveOpts -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch -XX:+UseLargePages -XX:+DisableExplicitGC -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -jar server.jar nogui
For Lifesteal. If a flag does not allow your server to start, remove the flag and let me know which one it was so we can substitute it. Send me a new gc.log and spark report in 60 minutes
Torrent
TorrentOP5mo ago
Oh just have to add -XX:+UnlockExperimentalVMOptions to lifesteal
Jared | InfraCharm
No... Getting rid of aikars flags entirely
Torrent
TorrentOP5mo ago
that's uhh what it said in console
Jared | InfraCharm
Ah okay XX:+UnlockExperimentalVMOptions It's in there already
Torrent
TorrentOP5mo ago
Unrecognized VM option 'AggressiveOpts'
Jared | InfraCharm
Thanks, remove it We were trying to make GC take precedence
Torrent
TorrentOP5mo ago
Lifesteal started Waiting for the proxy profiler to come back thanks so much for your help Jared
Jared | InfraCharm
Yep No worries
Torrent
TorrentOP5mo ago
Jared, Lifesteal just crashed; had 8.5GB allocated to the container with these flags:
java -Xms7G -Xmx7G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch -XX:+UseLargePages -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=85 -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch -XX:+UseLargePages -XX:+DisableExplicitGC -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -jar server.jar nogui
java -Xms7G -Xmx7G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch -XX:+UseLargePages -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=85 -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch -XX:+UseLargePages -XX:+DisableExplicitGC -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -jar server.jar nogui
Torrent
TorrentOP5mo ago
@Jared | InfraCharm https://spark.lucko.me/s8eMADoYIS this is my 2nd proxy server gc log is attached, as well as build config. Using these flags:
java -Xms128M -Xmx1024M -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=50 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:G1HeapRegionSize=16M -XX:MaxRAMPercentage=75 -Dmojang.sessionserver=https://api.minehut.com/mitm/proxy/session/minecraft/hasJoined -jar {{SERVER_JARFILE}}
java -Xms128M -Xmx1024M -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=50 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:G1HeapRegionSize=16M -XX:MaxRAMPercentage=75 -Dmojang.sessionserver=https://api.minehut.com/mitm/proxy/session/minecraft/hasJoined -jar {{SERVER_JARFILE}}
Ideally I'd like the allocated memory to be 1.5G for both proxies
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta5mo ago
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
Requested by torrentstaff
Admincraft Meta
Admincraft Meta5mo ago
Spark Profile Analysis
❌ Processing Error
The bot cannot process this Spark profile. It appears that the platform is not supported for analysis. Platform: Velocity
Requested by torrentstaff
Torrent
TorrentOP5mo ago
This was quite a long spark report, but I ran it on the SMP after changing the flags to your recommendations: https://spark.lucko.me/8YiJ7lddTG
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta5mo ago
Spark Profile Analysis
These are not magic values. Many of these settings have real consequences on your server's mechanics. See this guide for detailed information on the functionality of each setting.
✅ Your server isn't lagging
Your server is running fine with an average TPS of 20.
Requested by torrentstaff • Page 1 of 4
Torrent
TorrentOP5mo ago
Idk how this is possible, but switching to a custom docker image using graalvm fixed it… Thanks Skullian. Anyway !close !solved
Admincraft Meta
Admincraft Meta5mo ago
post closed!
The post/thread has been closed!
Requested by torrentstaff#0

Did you find this page helpful?