Aikar flags

Anytime I try Aikar flags for my server, my server just crashes. The server starts etc, but after a few minutes it just crashes. Im using pterodactyl panel btw, idk if that makes a difference.
108 Replies
Admincraft Meta
Admincraft Meta5mo 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 uekc#0
Skullians
Skullians5mo ago
- Send your flags - how much ram have you allocated to your ptero container (assuming you're using ptero / docker)
Louis_Dew
Louis_DewOP5mo ago
I'm not using aikar's flags rn, just standard flags that come with ptero, But when I used aikar's flags I used this:
java -Xms16384M -Xmx16384M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -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 -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -jar server.jar --nogui
java -Xms16384M -Xmx16384M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -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 -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -jar server.jar --nogui
Someone once said to remove the alwayspretouch flag so I already tried it with and without that flag already I have 16GB allocated
Skullians
Skullians5mo ago
Remove always pre touch. Set Xms and Xmx to 14336. (by the way allocating 12+gb is generally frowned upon because it can cause perf issues).
Casper
Casper5mo ago
xd ik servers that use 64gb
Louis_Dew
Louis_DewOP5mo ago
But im already using 9.27 GiB of ram with almost no players online What do big servers do that have 100 players on one server?
Skullians
Skullians5mo ago
how are you getting that statistic of 9.27gb usage
Louis_Dew
Louis_DewOP5mo ago
No description
Skullians
Skullians5mo ago
never use pterodactyl always use spark /spark healthreport ptero only shows the JVM usage and not the actual usage
Casper
Casper5mo ago
ptero incorrectly reads MC ram used
Louis_Dew
Louis_DewOP5mo ago
No description
Louis_Dew
Louis_DewOP5mo ago
oh lol only 3.9
Skullians
Skullians5mo ago
yup The reason why i told you to do this is because the AlwaysPreTouch flag preallocates all the memory, and i told you to reduce the Xms & Xmx because docker + the JVM likes to use 1-2gb more than it’s told to so you should always leave 1-2gb for overhead
Louis_Dew
Louis_DewOP5mo ago
alright So now it wont crash anymore?
Skullians
Skullians5mo ago
It shouldn’t. Try.
Louis_Dew
Louis_DewOP5mo ago
So when remove the pretouch flag I should remove all of this -XX:+AlwaysPreTouch ?
Skullians
Skullians5mo ago
yes
Louis_Dew
Louis_DewOP5mo ago
why is AlwaysPreTouch bad?
Skullians
Skullians5mo ago
read
Louis_Dew
Louis_DewOP5mo ago
Yeah but why is preallocating the memory a bad thing
Skullians
Skullians5mo ago
it preallocates all the memory, so if you set the Xms and Xmx to 16GB it will ‘reserve’ 16GB of ram, displaying as 16GB of ram usage. If your ram usage reaches the limits of the container, docker will kill the process that is called an OOME, or an out of memory exception
Louis_Dew
Louis_DewOP5mo ago
oooh alr Thanks! How much ram do servers that have 100 players online in one server use?
Skullians
Skullians5mo ago
depends
Louis_Dew
Louis_DewOP5mo ago
a survival smp for example
Skullians
Skullians5mo ago
One server i know of was using ~18GB with 155 plrs SMP I believe @professor confirm
professor
professor5mo ago
Yes
Skullians
Skullians5mo ago
:ThumbsUp: cheers there ya go
Skullians
Skullians5mo ago
^^^ flags are very dependent on hardware. Aikar’s is very generic and does it’s best. Would recommend a GC flag tuning service from the likes of @Jared | InfraCharm which is afaik $5
Jared | InfraCharm
CPU?
Louis_Dew
Louis_DewOP5mo ago
Intel Core i5-13500
Louis_Dew
Louis_DewOP5mo ago
This is all the hardwarre of my dedicated server
No description
Louis_Dew
Louis_DewOP5mo ago
Thank you for all of this information! greatly appreciated!
professor
professor5mo ago
np
Jared | InfraCharm
Do you want me to assist you in further optimizing the server for the system?
Louis_Dew
Louis_DewOP5mo ago
Yeah
Jared | InfraCharm
java -Xms16384M -Xmx16384M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -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 -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -jar server.jar --nogui
java -Xms16384M -Xmx16384M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -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 -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M -jar server.jar --nogui
Edit your startup to these and after 15 minutes send me a new spark report and the gc.log
Louis_Dew
Louis_DewOP5mo ago
Will try, but then on the other hand Skullians said not to use pretouch and lower Xms and Xmx to leave 1-2gb for overhead?
piggy
piggy5mo ago
@Louis_Dew
uekc has reached level 2! Roles Added: Level 2
Jared | InfraCharm
Keep it how you have it for now and just add -Xlog:gc*:file=gc.log:time,tags:filecount=5,filesize=10M like the example I sent above
Louis_Dew
Louis_DewOP5mo ago
👍 I have two, gc.log and gc.log.0 Which one do you want? Spark profiler is running rn
Jared | InfraCharm
gc.log - you must have rebooted since you added the flash for there to be two of them
Louis_Dew
Louis_DewOP5mo ago
I checked and my server crashed 2 hours ago So thats why it rebooted
Louis_Dew
Louis_DewOP5mo ago
Admincraft Meta
Admincraft Meta5mo ago
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
Requested by uekc
Louis_Dew
Louis_DewOP5mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta5mo ago
Spark Profile Analysis
These are not magic values. Many of these settings have real consequences on your server's mechanics. See this guide for detailed information on the functionality of each setting.
✅ Your server isn't lagging
Your server is running fine with an average TPS of 20.
Requested by uekc • Page 1 of 4
Discount Milk
Discount Milk5mo ago
Might help if your xms isn't the same as the xmx.
Jared | InfraCharm
Aikars does that - not sure why
Skullians
Skullians5mo ago
i've heard that it's necessary for aikar's flags to function properly not sure if that's true and if so why
Jared | InfraCharm
It makes no sense why though haha I should just make my own flags site at this point didn’t realize this service would be popular
Louis_Dew
Louis_DewOP5mo ago
You should Does everything seem fine? My server did crash tho a few hours ago
Jared | InfraCharm
Still looking at it all making your new flags
Discount Milk
Discount Milk5mo ago
Aikar flags are old af, they were written back in the days of Java 8 being minecrafts default. We need a refresh lol
Jared | InfraCharm
Taking you away from aikars
Louis_Dew
Louis_DewOP5mo ago
So why did people always keep suggesting me to use Aikar flags lol
ProGamingDk
ProGamingDk5mo ago
i agree with leche, the ones that people have tried to popularize like bruces are client focused and its test are by far not very accurate because theres no real better general flags aikars while old had research into them most flag sets nowadays are thrown together by people with no real knowledge or tested with tests that arent stable
Jared | InfraCharm
I’ll start putting a site together tonight haha Almost done here
Skullians
Skullians5mo ago
yes infra's flags are the new aikars :pepegun:
Jared | InfraCharm
@Louis_Dew
java -Xms8G -Xmx16G --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:+UseCriticalJavaThreadPriority -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseNUMA -XX:+OptimizeStringConcat -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseBiasedLocking -jar server.jar --nogui
java -Xms8G -Xmx16G --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:+UseCriticalJavaThreadPriority -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseNUMA -XX:+OptimizeStringConcat -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseBiasedLocking -jar server.jar --nogui
Update your memory on the container to 18GB Go ahead and run the server on this for about an hour. Send me the new gc.log after that. I enabled prefetch so it's optimized for Intel CPUs, added java thread priority, also optimized the GC a bit If a flag does not work on your server, simply remove it from the startup and let me know which one it was so we can substitute it next time!
Discount Milk
Discount Milk5mo ago
Do you know how much memory he's giving to the container?
Jared | InfraCharm
Ah forgot to mention, thanks for the heads up @Louis_Dew also before using those flags up your memory to 18GB on the container
Louis_Dew
Louis_DewOP5mo ago
Alright, thanks a lot! How do I know if a flag doesn't work for my server?
Discount Milk
Discount Milk5mo ago
It won't start
Louis_Dew
Louis_DewOP5mo ago
Alright the server or the flag?
Skullians
Skullians5mo ago
...the server
Louis_Dew
Louis_DewOP5mo ago
But how do I know which flag caused it?
Skullians
Skullians5mo ago
it will say
Louis_Dew
Louis_DewOP5mo ago
👍
Skullians
Skullians5mo ago
it's like the --add-modules=jdk.incubator.vector doesn't work on java 8 if you use it on java 8, it says "unrecognised VM option: --add-modules=jdk.incubator.vector" or something along those lines
Louis_Dew
Louis_DewOP5mo ago
Okey, thanks!
Swift
Swift5mo ago
Hey I was wandering if there was something for amd
Jared | InfraCharm
There are some things
Swift
Swift5mo ago
What would you suggest
Jared | InfraCharm
I can’t just suggest flags because they don’t work like that
Swift
Swift5mo ago
Ah what would you need info wise anyways?
Jared | InfraCharm
Spark report, gc log, system specs
Swift
Swift5mo ago
Ah, that’s sad since there is a big difference between the servers I run
Jared | InfraCharm
What do you mean?
Swift
Swift5mo ago
i mean sadly there isn't a close 1 fit for all then
Jared | InfraCharm
No, not at all Im working on a new site now that will automate my process of doing all of this
Swift
Swift5mo ago
i think you are taking over aikars job now
Jared | InfraCharm
well, someone's gotta do better wasn't really a high bar set in the first place
Swift
Swift5mo ago
God dam, stop hurting aikar he did his best xD
Jared | InfraCharm
InfraCharm Flags
Swift
Swift5mo ago
alookin good
Skullians
Skullians5mo ago
yo sick
Discount Milk
Discount Milk5mo ago
When you're done post this over in #resources!
Louis_Dew
Louis_DewOP5mo ago
AgressiveOpts UseFastAccessorMethods UseBiasedLocking These three don’t work
Jared | InfraCharm
Alright
Louis_Dew
Louis_DewOP5mo ago
Admincraft Meta
Admincraft Meta5mo ago
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
Requested by uekc
Jared | InfraCharm
oof
java -Xms8G -Xmx16G --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=100 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=1 -XX:G1MixedGCCountTarget=8 -XX:InitiatingHeapOccupancyPercent=10 -XX:+UseCriticalJavaThreadPriority -XX:G1MixedGCLiveThresholdPercent=85 -XX:G1RSetUpdatingPauseTimePercent=1 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=60 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=10 -XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseNUMA -XX:+OptimizeStringConcat -jar server.jar --nogui
java -Xms8G -Xmx16G --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=100 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=1 -XX:G1MixedGCCountTarget=8 -XX:InitiatingHeapOccupancyPercent=10 -XX:+UseCriticalJavaThreadPriority -XX:G1MixedGCLiveThresholdPercent=85 -XX:G1RSetUpdatingPauseTimePercent=1 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=60 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=10 -XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseNUMA -XX:+OptimizeStringConcat -jar server.jar --nogui
Louis_Dew
Louis_DewOP5mo ago
These flags work I think Thanks a lot! !solved
Admincraft Meta
Admincraft Meta5mo ago
post closed!
The post/thread has been closed!
Requested by uekc#0
Louis_Dew
Louis_DewOP5mo ago
I don’t know if the flags are the cause but it could be the case. The ram just goes up and up until the server crashes It takes like 8 hours and the servers ram just constantly goes higher slowly until OOM
Jared | InfraCharm
How often do you do restarts?
Louis_Dew
Louis_DewOP5mo ago
I restart daily
Jared | InfraCharm
Send another spark
Louis_Dew
Louis_DewOP5mo ago
👍🏻👍🏻👍🏻
Louis_Dew
Louis_DewOP5mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta5mo ago
Spark Profile Analysis
These are not magic values. Many of these settings have real consequences on your server's mechanics. See this guide for detailed information on the functionality of each setting.
✅ Your server isn't lagging
Your server is running fine with an average TPS of 20.
Requested by uekc • Page 1 of 5
Louis_Dew
Louis_DewOP5mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Meta5mo ago
Spark Profile Analysis
These are not magic values. Many of these settings have real consequences on your server's mechanics. See this guide for detailed information on the functionality of each setting.
✅ Your server isn't lagging
Your server is running fine with an average TPS of 20.
Requested by uekc • Page 1 of 5

Did you find this page helpful?