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
Admincraft Meta
Admincraft Meta2mo 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 zayde_storm#0
duolingo se acerca
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?
duolingo se acerca
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
Venerable
VenerableOP2mo ago
120 player cap each player uses about 256mb ram
Skullians
Skullians2mo ago
that’s just so wrong you can’t measure that you have plugins, mob farms etc that can all change this
Venerable
VenerableOP2mo ago
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.
Skullians
Skullians2mo ago
how did you get the 256mb/player value
Venerable
VenerableOP2mo ago
it's from some old thread so i wouldnt know, but they said vanilla was like 128mb at the time
Skullians
Skullians2mo ago
yeah sorry that’s fucking bullshit
Venerable
VenerableOP2mo ago
you dont gotta be rude about it
Skullians
Skullians2mo ago
I know 700 player servers that use only 34gb eh it’s just that How old was the thread?
Venerable
VenerableOP2mo ago
years ago some old spigot thread ill have to find it again
Skullians
Skullians2mo ago
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
Venerable
VenerableOP2mo ago
i have it set to dynamically allocate now
Skullians
Skullians2mo ago
I’ve heard it’s a bad idea but never seen an actual official result If you could keep me posted please ^^
Venerable
VenerableOP2mo ago
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.
Skullians
Skullians2mo ago
try temporarily increase worker threads if you want chunky to run faster
Venerable
VenerableOP2mo ago
i did hovered between 40-80 c/s
Skullians
Skullians2mo ago
that’s not bad
Venerable
VenerableOP2mo ago
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
Skullians
Skullians2mo ago
1 day of chunky for 50k * 50k is pretty good
duolingo se acerca
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 ram
Venerable
VenerableOP2mo ago
yeah i'm gonna experiment with ram usage a bit as the server grows
duolingo se acerca
What’s the focus of your server? If it’s an anarchy it could be reasonable since players try to get extremely far constantly
Venerable
VenerableOP2mo ago
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
duolingo se acerca
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
Venerable
VenerableOP2mo ago
I'm just playing it safe rn, worst case scenario i can always lower my ram allocation for a bit.
duolingo se acerca
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
Venerable
VenerableOP2mo ago
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
Venerable
VenerableOP2mo ago
well im close to reaching that
No description
Venerable
VenerableOP2mo ago
chunky only 13% done for 50k
Laupolio
Laupolio2mo ago
ZGC scales better than G1GC for large amounts of RAM
Skullians
Skullians2mo ago
Pregen is known for using a lot of ram
Venerable
VenerableOP2mo ago
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.

Did you find this page helpful?