How to dynamically allocate ram?
using paper 1.20.1 and my server is ran in a pterodactyl docker container with 30gb of ram allocated to it, but i know that overallocation can do more harm than good, so i was wondering if i could make it dynamically allocate ram as needed within those 30gb? I know there are some runtime arguments for that but i'm not sure how to make them dynamically allocate ram within said limit.
34 Replies
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 zayde_storm#0
You can set the flag
-Xms
to something below 30gb and keep -Xmx
at the limit you want
You might want to use ZGC as ur gc
Still, are you sure you need those 30gb?Also, give this guide a look to help you optimize the rest of the flags:
https://github.com/brucethemoose/Minecraft-Performance-Flags-Benchmarks
At the end there's a brief explanation of what each flag do
Still, a bit weird that you need that much ram
GitHub
GitHub - brucethemoose/Minecraft-Performance-Flags-Benchmarks: Sane...
Sane, Benchmarked Java Flags and Tweaks for Minecraft - brucethemoose/Minecraft-Performance-Flags-Benchmarks
120 player cap
each player uses about 256mb ram
that’s just
so wrong
you can’t measure that
you have plugins, mob farms etc that can all change this
the player itself, not their mob farbs etc
@Skullians
I know ima need an extra 6-8gb to handle that which i'll be getting soon.
how did you get the 256mb/player value
it's from some old thread so i wouldnt know, but they said vanilla was like 128mb at the time
yeah sorry that’s fucking bullshit
you dont gotta be rude about it
I know 700 player servers that use only 34gb
eh
it’s just that
How old was the thread?
years ago some old spigot thread
ill have to find it again
because Minecraft has arguably gotten more ram / hardware hungry as it has released new versions
sure extra ram means you won’t get random OOMs but more ram can actually cause performance issues
java GC actually kind of dies
after 12GB
without specific performance flag tuning
you have a very bad time
i have it set to dynamically allocate now
I’ve heard it’s a bad idea but never seen an actual official result
If you could keep me posted please ^^
im also gonna be setting some performance flags mentioned in this guide
sure
i have noticed some issues with chunky not making full use of it compared if i were to have lower ram, but thats just how it was designed.
try temporarily increase worker threads if you want chunky to run faster
i did
hovered between 40-80 c/s
that’s not bad
yeah i suppose, but i was trying to load a 50k radius lol
woulda taken an entire day of nonstop running even at 80 c/s
1 day of chunky for 50k * 50k is pretty good
Btw, also forgot to mention that dynamically allocating ram is still kind of an expensive task
Mostly the reason why startup scripts typically use the same value for both
-Xms
and -Xmx
120 players, unless you’re taking into account that they all are farming or doing constantly loading chunks, shouldn’t consume that much ramyeah i'm gonna experiment with ram usage a bit as the server grows
What’s the focus of your server?
If it’s an anarchy it could be reasonable since players try to get extremely far constantly
geopolitical, essentially nations rp
i cant seem to find any these days yet i know theres some insane demand for em.
I'm in marcusk's
but i wanted something more permanant
I get that feeling, I’m making the jump from seasonal servers to a more permanent network
Still, servers grow very slow
And 120 players shouldn’t take that much ram for nations
Still, if you feel you really need them, consider using ZCG as garbage collector
I'm just playing it safe rn, worst case scenario i can always lower my ram allocation for a bit.
Btw, you also don’t need the best resources from the start. If you have a maintenance window scheduled, you can upgrade (in your case, allocate more ram) once the server seems to be needing it
it's only $50/m
and thats mainly cause i got 2tb of ssd storage on it.
also i had someone from a clan of sorts approach me, they have like 100 people so i'm hoping at least 10-20 of them come over.
also, setting the large pages in java really helped a lot with performance, went from 60-80 chunks a second in chunky to nearly double that.
anyway im off to work
well im close to reaching that
chunky only 13% done for 50k
ZGC scales better than G1GC for large amounts of RAM
Pregen is known for using a lot of ram
anyway so i was an idiot setting pregen to double my worldborder lol, i thought it was diameter not radius
but yeah it's done now, and i'm switching over from squaremap to bluemap.