Ram allocation settings not working.

Hello, I have been trying to work on optimizing my MC server, as our player base increses I noticed people complaining and the server is using all its memory. I tried fixing this by adding more ram - java -Xmx17G -Xms5G @libraries/net/minecraftforge/forge/1.20.1-47.2.0/win_args.txt %* - but when I did this the amout of ram the server uses dose not change at all! its as if what im adding to the .bat has 0 affect. any guidence or help would be grate!
77 Replies
Admincraft Meta
Admincraft Metaβ€’8mo 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 thefeds2.0#0
Skullians
Skulliansβ€’8mo ago
How are you measuring the amount of RAM that the server is using
StealthyFeds
StealthyFedsOPβ€’8mo ago
The minecraft server pop up,
No description
ProGamingDk
ProGamingDkβ€’8mo ago
oh god that one should not be trusted its horrendus please add --nogui to the startup flags gives more performance, and is just better
StealthyFeds
StealthyFedsOPβ€’8mo ago
oh sorry im new to all of this so I dont really know what im doing haha where do I add it?
ProGamingDk
ProGamingDkβ€’8mo ago
to the end of java -Xmx17G -Xms5G @libraries/net/minecraftforge/forge/1.20.1-47.2.0/win_args.txt
StealthyFeds
StealthyFedsOPβ€’8mo ago
Like this, java -Xmx17G -Xms5G @libraries/net/minecraftforge/forge/1.20.1-47.2.0/win_args.txt--nogui %*?
Skullians
Skulliansβ€’8mo ago
yes
ProGamingDk
ProGamingDkβ€’8mo ago
no you need to add a space
Skullians
Skulliansβ€’8mo ago
oh not reading
StealthyFeds
StealthyFedsOPβ€’8mo ago
πŸ‘
Skullians
Skulliansβ€’8mo ago
right
ProGamingDk
ProGamingDkβ€’8mo ago
between win_args.txt and --nogui
StealthyFeds
StealthyFedsOPβ€’8mo ago
Added, and then will the proper amout of ram work? or whats a better way of seeing how much ram the server is acutly making
ProGamingDk
ProGamingDkβ€’8mo ago
using spark !spark
Carl-bot
Carl-botβ€’8mo ago
Spark Profiler
Spark can be used to see why your server or client is lagging. https://spark.lucko.me/
From An unknown user
Admincraft Canned Responses
StealthyFeds
StealthyFedsOPβ€’8mo ago
can it be added to a pre existing server?
Cracker
Crackerβ€’8mo ago
Yes it’s a mod & plugin Add it to your mods folder
StealthyFeds
StealthyFedsOPβ€’8mo ago
Okay πŸ™‚
Cracker
Crackerβ€’8mo ago
Should have a forge download there
StealthyFeds
StealthyFedsOPβ€’8mo ago
Is this a server sided mod only?
ProGamingDk
ProGamingDkβ€’8mo ago
yes can also be used on client but not needed
StealthyFeds
StealthyFedsOPβ€’8mo ago
Should a new window open when the server restarts?
ProGamingDk
ProGamingDkβ€’8mo ago
should be in a terminal/command prompt window nogui turns off the gui
StealthyFeds
StealthyFedsOPβ€’8mo ago
I see the normal black windows\system32\cmd.exe but no new speical window for Spark
ProGamingDk
ProGamingDkβ€’8mo ago
oh no spark doesnt do a ui on your computer, its uses web not taht you need it for your needs just do /spark healthreport
StealthyFeds
StealthyFedsOPβ€’8mo ago
in game? or like in the CMD on my VPS?
ProGamingDk
ProGamingDkβ€’8mo ago
ingame if you have op
StealthyFeds
StealthyFedsOPβ€’8mo ago
Do I need spark installed client side for it to work? I did /spark healthreport in game and nothing shows in text box. I am op I see it as a comand now in game so I know its working in that way
ProGamingDk
ProGamingDkβ€’8mo ago
shouldnt need to, try and run it in console without the /
StealthyFeds
StealthyFedsOPβ€’8mo ago
No description
StealthyFeds
StealthyFedsOPβ€’8mo ago
it did something but idk if thats random or important lol
ProGamingDk
ProGamingDkβ€’8mo ago
youre using the wrong spark version
ProGamingDk
ProGamingDkβ€’8mo ago
CurseForge
spark
spark is a performance profiler for Minecraft clients, servers and proxies. 76.7M Downloads | Mods
StealthyFeds
StealthyFedsOPβ€’8mo ago
Oh. Idk I just downloaded of the site and clicked forge from this link Let me try again now
StealthyFeds
StealthyFedsOPβ€’8mo ago
No description
StealthyFeds
StealthyFedsOPβ€’8mo ago
Worked! seems my issue may be tick related, any suggestions on performace imporvments?
ProGamingDk
ProGamingDkβ€’8mo ago
use /spark profiler start --timeout 300 we can check whats up (windows does make everything worse as it doesnt support async profiling)
StealthyFeds
StealthyFedsOPβ€’8mo ago
Its all I have sadly hahah Okay I stopped and uploaded idk if its okay to post the link here, or if it has lots of perosnal info in it lol
Skullians
Skulliansβ€’8mo ago
send it
StealthyFeds
StealthyFedsOPβ€’8mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Admincraft Meta
Admincraft Metaβ€’8mo ago
Spark Profile Analysis
❌ Processing Error
The bot cannot process this Spark profile. It appears that the platform is not supported for analysis. Platform: Forge
Requested by thefeds2.0#0
Skullians
Skulliansβ€’8mo ago
- use aikar flags - create mod is lagging kind of hard - you have a shitty cpu which is the main reason of your lag
ProGamingDk
ProGamingDkβ€’8mo ago
set sync-chunk-writes to false in server.properties
StealthyFeds
StealthyFedsOPβ€’8mo ago
aikar flags? whats that?
ProGamingDk
ProGamingDkβ€’8mo ago
assuming its not running on a hdd
Skullians
Skulliansβ€’8mo ago
flags.sh
flags.sh
A simple script generator to start your Minecraft servers with optimal flags.
Skullians
Skulliansβ€’8mo ago
add this to your JVM args
--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=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20
--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=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20
for startup
StealthyFeds
StealthyFedsOPβ€’8mo ago
above or below the other thing we added?
Skullians
Skulliansβ€’8mo ago
send your current startup flag configs
StealthyFeds
StealthyFedsOPβ€’8mo ago
@echo off REM Forge requires a configured set of both JVM and program arguments. REM Add custom JVM arguments to the user_jvm_args.txt REM Add custom program arguments {such as nogui} to this file in the next line before the %* or REM pass them to this script directly java -Xmx17G -Xms5G @libraries/net/minecraftforge/forge/1.20.1-47.2.0/win_args.txt --nogui %* pause
Snow Kit
Snow Kitβ€’8mo ago
you'd put aikar's flags inside of user_jvm_args.txt
StealthyFeds
StealthyFedsOPβ€’8mo ago
No description
StealthyFeds
StealthyFedsOPβ€’8mo ago
in this?
Skullians
Skulliansβ€’8mo ago
yeah just paste it all in on a new line
StealthyFeds
StealthyFedsOPβ€’8mo ago
No description
Skullians
Skulliansβ€’8mo ago
yes
StealthyFeds
StealthyFedsOPβ€’8mo ago
and will this start with my current .bat? cuz I dont see it mention anything with the user_jvm_args
Skullians
Skulliansβ€’8mo ago
it should
StealthyFeds
StealthyFedsOPβ€’8mo ago
Before someone else helped me the bat was @echo off REM Forge requires a configured set of both JVM and program arguments. REM Add custom JVM arguments to the user_jvm_args.txt REM Add custom program arguments {such as nogui} to this file in the next line before the %* or REM pass them to this script directly java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.20.1-47.2.0/win_args.txt %* pause and this mentioned the jvm, should I change it back to this, and add the new --nogui line to it? or should I just keep the bat the same.
Skullians
Skulliansβ€’8mo ago
in user_jvm_args add --nogui to a new line and then set your bat to this
StealthyFeds
StealthyFedsOPβ€’8mo ago
Like this?
No description
No description
Skullians
Skulliansβ€’8mo ago
yes
StealthyFeds
StealthyFedsOPβ€’8mo ago
πŸ‘πŸ‘πŸ‘ And last thing, you said my CPU was bad, I only have 8 cores RN, should I get 12... 16 or even more?
Skullians
Skulliansβ€’8mo ago
Minecraft is primarily single threaded. Therefore cores doesn't matter, singlethreaded performance does and that Xeon does not have a good singlethread iirc
StealthyFeds
StealthyFedsOPβ€’8mo ago
Ah, cuz I have a VPS though a provider so I didnt know
ProGamingDk
ProGamingDkβ€’8mo ago
oof vps makes performance even worse
Skullians
Skulliansβ€’8mo ago
^ and uh windows datacenter isn't ideal
StealthyFeds
StealthyFedsOPβ€’8mo ago
Okay, well hopefully all the changes made will help atlest a bit I will go test and make sure the server still works hahah thanks!! oh says it dose not recognize --nogui
StealthyFeds
StealthyFedsOPβ€’8mo ago
No description
ProGamingDk
ProGamingDkβ€’8mo ago
try removing the -- and just having nogui
StealthyFeds
StealthyFedsOPβ€’8mo ago
No description
ProGamingDk
ProGamingDkβ€’8mo ago
"the" why is there a the in there
Skullians
Skulliansβ€’8mo ago
xd
StealthyFeds
StealthyFedsOPβ€’8mo ago
No description
Skullians
Skulliansβ€’8mo ago
remove --nogui (or nogui) from user_jvm_args and in start.bat, do java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.20.1-47.2.0/win_args.txt --nogui %*
StealthyFeds
StealthyFedsOPβ€’8mo ago
Thanks guys!

Did you find this page helpful?