perplexing memory issues
Running a heavily modded, 8gb 1.20.1 Forge server through Witherhosting, and it crashes very randomly with the exit code 137. Sometimes it will crash when a new person joins, sometimes just randomly when we're not doing anything in specific. Here are the startup arguments I have for it:
java -Xms128M -Xmx7G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+UseContainerSupport -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 -Dterminal.jline=false -Dterminal.ansi=true $( [[ ! -f unix_args.txt ]] && printf %s "-jar server.jar" || printf %s "@unix_args.txt" )
Here are some Spark profiles:
https://spark.lucko.me/dXbtNQ71xo
https://spark.lucko.me/x85cSTC3AC
https://spark.lucko.me/c15qaZpfQb
https://spark.lucko.me/pagJTnQMTq
https://spark.lucko.me/T62Hhsnn5O
https://spark.lucko.me/zX4mTnRpBn
We spent all of last night meticulously adding the mods one by one to try and see if a particular mod might have a memory leak, but we found absolutely no rhyme or reason to what was causing the issues. No matter the arrangements of mods, we still had OOM crashes.
Modlist is attached. Server is using Java 21, and Forge version is 47.3.0.
What could be causing this issue? I've been trying all day and night to get Witherhosting to migrate my server to a new node because I figure at this point, that's the only thing I can think of that might be causing my server's problems. Any help would be greatly appreciated!9 Replies
Spark Profile Analysis
❌ Processing Error
The bot cannot process this Spark profile. It appears that the platform is not supported for analysis. Platform: Forge
Requested by ethonodon
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 ethonodon#0
1 gb overhead can just not be enough
i usually recommend 1.5-2
what/where is that?
in your startup flags
set xmx to 6.5- 6
!oom
My server is using too much memory
My panel says my memory usage is high all the time.
Your server runs in the Java Virtual Machine (JVM), which has significant overhead & tries to effectively use ALL of the memory assigned to it.
Memory usage from "htop", Task Manager, or your server panel is the total consumption of the JVM, not just your server.
My server is lagging & I think it's memory related.
It's much more likely that you are bottlenecked by your CPU, disk, or some inefficient mod/plugin.
Rule of thumb, servers should have anywhere from 4GB to 12GB of memory, with 8GB being the 'sweet spot'.
If you're heavily modded, add 4GB to that.
Too much memory can be a bad thing. Don't exceed these caps unless you really know why you're doing it.
Troubleshoot your server the right way: use Spark & send us a report.
My server is randomly terminated unexpectedly.
Setting your server to use 8GB does not mean that Java won't exceed this amount.
As a rule of thumb, allow your system/container about 1-2GB (possibly more) overhead outside of the server.
If you're on Linux & can SSH into the system, check your kernel logs. They will report any incidents of OOM.
I want to use swap to allocate more memory.
Don't. Swap is not free memory and using it can negatively impact performance.
Admincraft Canned Responses
yeah, I tried both 6 and 6.5 before but it was still crashing
I think those spark reports were from when I was using 6-6.5(?)
have you asked your host btw
yes, they've not been easy to contact though
last night I asked them to move my server to a different node, but they didn't and instead "modified some settings on the back-end of the server" (which didn't help), so this morning I asked again if the server could be moved and there has been no response
I figured I've ruled out pretty much everything except like a faulty node or something atp
and I've run *larger * modpacks through a different host (bisecthosting) in the past with 0 issue on 8gb servers, so I'm fairly certain just upgrading to have more ram won't fix it either
on the 14th they also reported issues with the node my server is on, and although they listed that as resolved now, that just further adds to my suspicion something is not right there