Potential memory leak, trying to find cause
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
53 Replies
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 .deathpacito#0 • Page 1 of 5
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 .deathpacito#0
Server ram usage keeps going up and up till server hits a forced restart, I don't see any crashes in crashlogs
Server running latest build of Paper 1.20.4
This ram usage issue happens over the course of hours but I am unsure as to how and why, my suspicion is Pl3xmap or MythicDungeons getting involved somewhere
your GC is dying
Try run an alloc profiler and / or a heapsummary
Use Aikar flags
Link is dead, spark profiler open moment
Didn’t have anything beneficial
Also how long does it take for these memory leaks to kill the server
Approx every 6 hours
Seems to accelerate when people are on the server ish?
how many players
1
It's just me on and the ram usage just eventually maxes out standing in spawn
Server is currently undergoing a scheduled restart
Baseline after restart is around 4/6 gb
Startup flags limits to 80% of container so 4.8gb
I can allocate more memory if needed, just trying to figure out what the issue is
Make an allocation profiler and a heapsummary
Heap summary https://spark.lucko.me/QSDOHtxbfh
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
❌ Processing Error
The bot cannot process this Spark profile. This is a heap summary report.
Requested by .deathpacito#0
Not sure how to create an allocation profiler
/spark profiler start --alloc
I believe
Use Aikar flags!!!
use pufferfish!!!Alloc profiler https://spark.lucko.me/1XRuIw8Y0C
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
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 .deathpacito#0 • Page 1 of 5
Thanks for the 11 second profiler with no data
Run it for at least 5 minutes
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
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 .deathpacito#0 • Page 1 of 5
Are there any downsides swapping from paper to pufferfish?
Don't use spark profiler open please
Recreate the issue with the profiler running and then use spark profiler stop
The issue is i'm not exactly sure how the issue is created, do I just run it for a couple hours before stopping?
All I notice is the ram usage goes up over a couple hours before crash and server restart
Also this is a server on a velocity proxy, do I still use aikars flags or do I use that velocity option? I can't tell if that option is better or not
Stopped the profiler https://spark.lucko.me/iI1KCPyHeP
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
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 .deathpacito#0 • Page 1 of 5
Do you have any plugins that store world information in memory, something that handles block roll backs after a time?
Any RTP esque plugins?
I've seen both cause issues with memory
MythicDungeons I know for sure causes memory leaks, but there are no dungeons even available, I just added it for parity with my other server.
Coreprotect fits the bill but I don't think that's it
Xenoworldreset does RTP's, that might be the plugin with the problem as they actively test for and save RTP locations of all available worlds. It also allows you to reset worlds on a schedule, though I do it manually
Pl3xmap had terrible interactions with Mythicdungeons due to holding onto worlds MD was trying to delete, but there are no dungeons on the server so I doubt it
Overall if it's XenoWorldReset I might need to disable their RTP function entirely and go with something like BetterRTP
It's getting up there again
Have you put on aikar flags
Nope, was asking about this
Not sure what the difference is here
I have 3 servers all managed through velocity
you'd use the velocity / waterfall flag for the velocity proxy itself
Do I paste the aikars for 6GB in this field?
backend servers have just normal aikar flags
Ah I see
Should I leave min ram and max ram the same at 80% instead of a specific value? I think I need to leave overhead for the container in ptero
Then add in the remainder from aikars
I just caught it!
I added this section of Aikars
I suspect the issue is that the container ends up taking over 1.2GB of ram when there is only 1.2GB allocated for it (20% of 6GB), I don't see the server ram usage hit its cap
Starting another /spark profiler start --alloc
the issue is, the server RAM shouldn't be ramping up in the first place
especially if you're sitting at spawn not moving
It seems to be every 2 hours after adding aikars
I've bumped up ram to 8GB temporarily
Remove the disableexplicitgc flag
Pl3xmap calls the garbage collector, to clean up the memory. That flag prevents plugins from calling it, thus the memory never being cleaned up, thus killing ur server
Thanks, done
Lets see how it goes
Current flags:
java -Xms4096M -XX:MaxRAMPercentage=80.0 --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -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_JARFILE}}
Aikar's Thoughts
JVM Tuning: Optimized G1GC for Minecraft - Aikar's Thoughts
Learn more about my In depth study on tuning the G1GC garbage collector to be optimized for how Minecraft servers run, and keep low pause efficient usage.
Ram allocated = 8GB right now
Interesting… never realised that
Ya, it’s why you’ll see a lot of people complain pl3xmap unusable
Considering it's causing the servers I run it on to eat ram yeah I get the sentiment
It was also suffering to use with MythicDungeons
Had to manually exclude it from touching every single dungeon map +3 more names
Aikar/Paper reasoning for including the flag seems weird to me
This just seems like such a bad approach