Potential memory leak, trying to find cause

spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
53 Replies
Admincraft Meta
Admincraft Meta7mo 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 .deathpacito#0 • Page 1 of 5
Admincraft Meta
Admincraft Meta7mo 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 .deathpacito#0
Deathpacito
DeathpacitoOP7mo ago
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
Skullians
Skullians7mo ago
your GC is dying Try run an alloc profiler and / or a heapsummary Use Aikar flags
Discount Milk
Discount Milk7mo ago
Link is dead, spark profiler open moment
Skullians
Skullians7mo ago
Didn’t have anything beneficial Also how long does it take for these memory leaks to kill the server
Deathpacito
DeathpacitoOP7mo ago
Approx every 6 hours
Deathpacito
DeathpacitoOP7mo ago
Seems to accelerate when people are on the server ish?
No description
Skullians
Skullians7mo ago
how many players
Deathpacito
DeathpacitoOP7mo ago
1 It's just me on and the ram usage just eventually maxes out standing in spawn Server is currently undergoing a scheduled restart
Deathpacito
DeathpacitoOP7mo ago
Baseline after restart is around 4/6 gb
No description
Deathpacito
DeathpacitoOP7mo ago
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
Skullians
Skullians7mo ago
Make an allocation profiler and a heapsummary
Deathpacito
DeathpacitoOP7mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta7mo ago
❌ Processing Error
The bot cannot process this Spark profile. This is a heap summary report.
Requested by .deathpacito#0
Deathpacito
DeathpacitoOP7mo ago
Not sure how to create an allocation profiler
Skullians
Skullians7mo ago
/spark profiler start --alloc I believe Use Aikar flags!!! use pufferfish!!!
Deathpacito
DeathpacitoOP7mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta7mo 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 .deathpacito#0 • Page 1 of 5
Skullians
Skullians7mo ago
Thanks for the 11 second profiler with no data Run it for at least 5 minutes
Deathpacito
DeathpacitoOP7mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta7mo 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 .deathpacito#0 • Page 1 of 5
Deathpacito
DeathpacitoOP7mo ago
Are there any downsides swapping from paper to pufferfish?
Discount Milk
Discount Milk7mo ago
Don't use spark profiler open please Recreate the issue with the profiler running and then use spark profiler stop
Deathpacito
DeathpacitoOP7mo ago
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
Deathpacito
DeathpacitoOP7mo ago
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
No description
Deathpacito
DeathpacitoOP7mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta7mo 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 .deathpacito#0 • Page 1 of 5
Discount Milk
Discount Milk7mo ago
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
Deathpacito
DeathpacitoOP7mo ago
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
Deathpacito
DeathpacitoOP7mo ago
It's getting up there again
No description
Skullians
Skullians7mo ago
Have you put on aikar flags
Deathpacito
DeathpacitoOP7mo ago
Nope, was asking about this Not sure what the difference is here I have 3 servers all managed through velocity
Skullians
Skullians7mo ago
you'd use the velocity / waterfall flag for the velocity proxy itself
Deathpacito
DeathpacitoOP7mo ago
Do I paste the aikars for 6GB in this field?
No description
Skullians
Skullians7mo ago
backend servers have just normal aikar flags
Deathpacito
DeathpacitoOP7mo ago
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!
Deathpacito
DeathpacitoOP7mo ago
No description
No description
Deathpacito
DeathpacitoOP7mo ago
I added this section of Aikars
No description
Deathpacito
DeathpacitoOP7mo ago
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
Skullians
Skullians7mo ago
the issue is, the server RAM shouldn't be ramping up in the first place especially if you're sitting at spawn not moving
Deathpacito
DeathpacitoOP7mo ago
No description
Deathpacito
DeathpacitoOP7mo ago
It seems to be every 2 hours after adding aikars I've bumped up ram to 8GB temporarily
QarthO
QarthO7mo ago
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
Deathpacito
DeathpacitoOP7mo ago
Thanks, done Lets see how it goes
Deathpacito
DeathpacitoOP7mo ago
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.
Deathpacito
DeathpacitoOP7mo ago
Ram allocated = 8GB right now
Skullians
Skullians7mo ago
Interesting… never realised that
QarthO
QarthO7mo ago
Ya, it’s why you’ll see a lot of people complain pl3xmap unusable
Deathpacito
DeathpacitoOP7mo ago
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
QarthO
QarthO7mo ago
Aikar/Paper reasoning for including the flag seems weird to me
QarthO
QarthO7mo ago
No description
QarthO
QarthO7mo ago
This just seems like such a bad approach

Did you find this page helpful?