A
Admincraftโ€ข3mo ago
Venerable

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 Metaโ€ข3mo 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
๐๐ข๐ช๐ฎ๐š๐ญ๐ž๐ซ๐ง๐ข๐จ๐ง๐ฌ
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
Venerable
VenerableOPโ€ข3mo ago
120 player cap each player uses about 256mb ram
Skullians
Skulliansโ€ข3mo ago
thatโ€™s just so wrong you canโ€™t measure that you have plugins, mob farms etc that can all change this
Venerable
VenerableOPโ€ข3mo 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
Skulliansโ€ข3mo ago
how did you get the 256mb/player value
Venerable
VenerableOPโ€ข3mo ago
it's from some old thread so i wouldnt know, but they said vanilla was like 128mb at the time
Skullians
Skulliansโ€ข3mo ago
yeah sorry thatโ€™s fucking bullshit
Venerable
VenerableOPโ€ข3mo ago
you dont gotta be rude about it
Skullians
Skulliansโ€ข3mo ago
I know 700 player servers that use only 34gb eh itโ€™s just that How old was the thread?
Venerable
VenerableOPโ€ข3mo ago
years ago some old spigot thread ill have to find it again
Skullians
Skulliansโ€ข3mo 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
VenerableOPโ€ข3mo ago
i have it set to dynamically allocate now
Skullians
Skulliansโ€ข3mo ago
Iโ€™ve heard itโ€™s a bad idea but never seen an actual official result If you could keep me posted please ^^
Venerable
VenerableOPโ€ข3mo 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
Skulliansโ€ข3mo ago
try temporarily increase worker threads if you want chunky to run faster
Venerable
VenerableOPโ€ข3mo ago
i did hovered between 40-80 c/s
Skullians
Skulliansโ€ข3mo ago
thatโ€™s not bad
Venerable
VenerableOPโ€ข3mo 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
Skulliansโ€ข3mo ago
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 ram
Venerable
VenerableOPโ€ข3mo ago
yeah 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
Venerable
VenerableOPโ€ข3mo 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
๐๐ข๐ช๐ฎ๐š๐ญ๐ž๐ซ๐ง๐ข๐จ๐ง๐ฌ
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
VenerableOPโ€ข3mo ago
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
Venerable
VenerableOPโ€ข3mo 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
VenerableOPโ€ข3mo ago
well im close to reaching that
No description
Venerable
VenerableOPโ€ข3mo ago
chunky only 13% done for 50k
Laupolio
Laupolioโ€ข3mo ago
ZGC scales better than G1GC for large amounts of RAM
Skullians
Skulliansโ€ข3mo ago
Pregen is known for using a lot of ram
Venerable
VenerableOPโ€ข3mo 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?