How to Allicate more memory to FTB Server?

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord
M

Mholmes

Guest
I've searched several tuts on how to do this and none of them seem to work or even be relevant to my server. My understanding is you need to modify "ServerStart.bat" file using notepad. Below Is a copy of mine.
Code:
if NOT "%FTB_VERBOSE%"=="yes" (
    @echo off
)

if NOT EXIST minecraft_server.1.7.10.jar (
    echo running install script!
    call FTBInstall.bat
)

REM Check if java in path
where java > NUL 2>&1

if %ERRORLEVEL% NEQ 0 (
    echo No java binary in path. Can't run server, exiting...
    pause
    exit /B
)

REM Test JVM
REM e.g. 32-bit JVM does not have server\jvm.dll library
java -server -version > java-test.log 2>&1

if %ERRORLEVEL% NEQ 0 (
    echo Detected following JVM error:
    echo =======================================
    cat java-test.log
    echo =======================================
    echo JVM test failed. Can't run server, Exiting...
    pause
    exit /B
)

if not exist eula.txt (
    echo Missing eula.txt. Startup will fail and eula.txt will be created
    echo Make sure to read eula.txt before playing!
    goto startserver
)

find "eula=false" eula.txt 1 > NUL 2>&1
if %ERRORLEVEL% EQU 0 (
     echo Make sure to read eula.txt before playing! Exiting.
     pause
     exit /B
)

:startserver
java -server -Xms1024m -Xmx2g -XX:PermSize=500m -d64 -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar FTBServer-1.7.10-1448.jar nogui
echo Server process finished
pause

Being an experienced .net dev I assume the section I need to modify is this:

Code:
:startserver
java -server -Xms1024m -Xmx2g -XX:PermSize=500m -d64 -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar FTBServer-1.7.10-1448.jar nogui
echo Server process finished
pause

So what am I doing wrong here? Sorry I don't know the Java syntax that well. I do know Java is case sensitive language. That's about the end of my Java knowledge. I would like to dedicate 2Gigs of memory to my server currently and later on I will want to dedicate about 12 gigs.
 

mc.crab

Well-Known Member
Feb 2, 2013
1,397
116
89
This is what my start file looks like:
Code:
java -XX:+UseG1GC -XX:+UseFastAccessorMethods -XX:+OptimizeStringConcat -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m  -XX:+AggressiveOpts -XX:MaxGCPauseMillis=10 -XX:+UseStringDeduplication -Xms4G -Xmx6G -XX:hashCode=5 -Dfile.encoding=UTF-8 -jar Thermos-1.7.10-1614-56-server.jar --log-strip-color

It looks a bit different beacuse I use Thermos to run the server but -Xms and -Xmx is what you want to change.
 
M

Mholmes

Guest
Thanks ill give it a shot

Edit:
yeah I changed the default to what I have above and its not working so that's the question what do I need to change it too? Sorry your reply did not dawn on me until I tried to apply what you said and it really did not say hay try this is was more of a generic comment. I assume they are two different systems and I've change the XM from the original to what I posted and its not working so that's why I am asking what did I do wrong. So thank you for the reply but I think I need further troubleshooting steps to resolve my issue.
 
Last edited:

mc.crab

Well-Known Member
Feb 2, 2013
1,397
116
89
Where are you hosting the server? If it's one of those Minecraft hosting services you can't change the allocated memory. Also how are you checking that your changes are not working?
 
M

Mholmes

Guest
Self hosting on my server machine (dedicated server). When I launch the FTB gui for the server it says a % of how much is being used.
 
J

Johnnyc

Guest
Try changing xmx from 2g to 2048m also change permsize to 512...

so change
java -server -Xms1024m -Xmx2g -XX:permSize=500m

to
java -server -Xms1024m -Xmx2048 -XX:permSize=512m