Recent Discussions

Do I need to upgrade my server RAM?

Unanswered
Cape lion posted this in #questions
Messages34 messages
Views0 views
Cape lionOP
Hi!

I just started a new modded MC server and we've been having issues where our memory reaches the maximum 8 GiB provided by our host despite having only 3-4 players on at a time usually. I've been told that the solution is to upgrade to more RAM but my hunch is that this is likely due to plugins/memory management rather than a hardware constraint. With only 1 player on we're using 3.5 GiB of RAM which feels odd, but I wanted to know if that's actually normal for a MC server or indicative that plugins/server configs may be at fault.

https://spark.lucko.me/ztDNZ3cfD1 Here's our spark heapsummary, screenshots for convenience:
image.png
image.png
image.png
@Connecticut Warbler Where are you looking for memory usage
Cape lionOP
Pterodactyl dashboard, SparkedHost (on mobile atm sorry)
IMG_6753.png
Its saying we’re using 3.5?
@Cape lion Pterodactyl dashboard, SparkedHost (on mobile atm sorry)
Connecticut Warbler
Sparked host either has 0 clue about how anything works or is legitmately trying to rip you off /shrug/
Dashboard will basically always be wrong
Due to how the jvm and flags work
Cape lionOP
okay so instead of relying on the dashboard I should just be using spark tickmonitor and spark heapsummary when I’m actually experiencing issues?
Connecticut Warbler
Spark profiler/spark healthreport
But yeah youre using 800 mb in the report you sent
Which includes spawn chunks etc
Cape lionOP
okay lol, yeah I was wondering why it wasnt adding up. What about that non-heap memory though? Is that just for infra overhead?
Should I be worried about that being so close to what’s committed?
Connecticut Warbler
@Skullians [always-ping] have fun answering that
Cape lionOP
very nervous when someone with “always-ping” is pinged lmao
will look into spark docs on profiler and healthreport for sure though. Thanks for the help!
when you’re worried about ram you have to compare two things:
1. the heap memory - this is pretty much where all the mc data is stored while your server is running. This is why you see on spark profilers. If you see it nearing the maximum on spark, then you might need to consider purchasing more RAM.
2. The non heap memory. This is shown on your web panel. This memory isn’t in the heap memory, but shouldn’t be overlooked.

In a nutshell, spark shows how much ram the JVM itself is using, while pterodactyl shows how much the process is using on a system level. Panels like the one you’re using will forcefully kill the process if it reaches the maximum. This is called an OOM(E) (out of memory(exception)).

If you, let’s say, have spark showing 2gb usage and the panel shows 8gb - and the panel usage keeps increasing while spark fluctuates, this is called a native leak.

Java is very closely tied in with C/C++ code, and will often make ‘native memory allocations’. These can’t be detected by spark heapdumps or heapsummaries and don’t contribute to the heap memory. Plugins and mods can cause these, a common example is not closing SQLite database statements or their underlying connection.

These make them incredibly hard to diagnose.

HOWEVER!. A native memory leak is only when your off heap ram usage (displayed on a web panel like you’re using) increases without going down, while your heap memory (spark) stays relatively low.

Additionally, panels like yours run servers in docker containers, which often cause these JVM to use 1-2gb more memory (off heap).
the general rule of thumb is: if you expect your mc server to use n GB of RAM, you purchase the n + 2 GB plan.
@Cape lion
So if your panel ram usage stays with a reasonable usage range then it shouldn’t be much to worry about
@Skullians [always-ping] when you’re worried about ram you have to compare two things:
1. the heap memory - this is pretty much where all the mc data is stored while your server is running. This is why you see on spark profilers. If you see it nearing the maximum on spark, then you might need to consider purchasing more RAM.
2. The non heap memory. This is shown on your web panel. This memory isn’t in the heap memory, but shouldn’t be overlooked.

In a nutshell, spark shows how much ram the JVM itself is using, while pterodactyl shows how much the process is using on a system level. Panels like the one you’re using will forcefully kill the process if it reaches the maximum. This is called an OOM(E) (out of memory(exception)).

If you, let’s say, have spark showing 2gb usage and the panel shows 8gb - and the panel usage keeps increasing while spark fluctuates, this is called a native leak.

Java is very closely tied in with C/C++ code, and will often make ‘native memory allocations’. These can’t be detected by spark heapdumps or heapsummaries and don’t contribute to the heap memory. Plugins and mods can cause these, a common example is not closing SQLite database statements or their underlying connection.

These make them incredibly hard to diagnose.

HOWEVER!. A native memory leak is only when your off heap ram usage (displayed on a web panel like you’re using) increases without going down, while your heap memory (spark) stays relatively low.

Additionally, panels like yours run servers in docker containers, which often cause these JVM to use 1-2gb more memory (off heap).
the general rule of thumb is: if you expect your mc server to use n GB of RAM, you purchase the n + 2 GB plan.
Cape lionOP
Thank you for the explanation - much appreciated and easy to follow
i try my best :P
Cape lionOP
so right now on the dashboard I'm maxed out at 8.4/8 GiB, here's the spark dump from that time: https://spark.lucko.me/U6991FwFwl So is this a sign that a plugin is an issue or do I need to upgrade RAM? There's 3 players on atm
@Cape lion so right now on the dashboard I'm maxed out at 8.4/8 GiB, here's the spark dump from that time: https://spark.lucko.me/U6991FwFwl So is this a sign that a plugin is an issue or do I need to upgrade RAM? There's 3 players on atm
Connecticut Warbler
No youre only using 5, changing startup flags should help show a more accurate number on panel, also dont use spigot its awful in every shape and form basically
@Cape lion Should I switch to paper?
Connecticut Warbler
Yes
Loading...