JVM Arguments for Modded Minecraft (Updated 12/30/13)

  • 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

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
Updated 12/30/13
**Please Note**
The following performance tweaks REQUIRE
a 64bit OS, Java7u45 (or above), and a minimum of 3GBs of free RAM.
I will also continue to keep these updated
if I find better ways to increase performance.

Special thanks to Keybounce for his research and ideas

Time for a reboot. Going back to basics with profiling on Monster. At this time
all compilation flags are being removed until i decide it is worth keeping them. For now,
I will be concentrating on issues with GC and memory.

These arguments are now outdated and not working properly!
I will start a new thread when I have time under a new section since this is now archived.

Original Argument Post
Last Argument Post



-Xms2048m -Xmx2048m -XX:PermSize=256m -XX:NewRatio=3 -XX:SurvivorRatio=3 -XX:TargetSurvivorRatio=80 -XX:MaxTenuringThreshold=8 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:MaxGCPauseMillis=10 -XX:GCPauseIntervalMillis=50 -XX:MaxGCMinorPauseMillis=7 -XX:+ExplicitGCInvokesConcurrent -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+BindGCTaskThreadsToCPUs -Xnoclassgc


Setting up:
Copy and paste the above arguments into the .bat/.sh file you use to start your server.
Adjust Xms and Xmx to your desired RAM amount leaving at least 1GB open for PermGen and CodeCache
*note:setting the Heap above 4GB may cause issues with garbage collection

-XX:NewRatio=3 -XX:SurvivorRatio=3 -XX:TargetSurvivorRatio=80 -XX:MaxTenuringThreshold=8 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:MaxGCPauseMillis=10 -XX:GCPauseIntervalMillis=50 -XX:MaxGCMinorPauseMillis=7 -XX:+ExplicitGCInvokesConcurrent -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+BindGCTaskThreadsToCPUs -Xnoclassgc


Setting up:
Click the Icon with the screwdriver and computer.
Select the tab that says Java
Set Minimum memory allocation to 2048, maximum memory allocation to 2048, and permgen to 256.
Copy the arguments above and paste them into JVM arguments

-Xms2048m -XX:PermSize=256m -XX:NewRatio=3 -XX:SurvivorRatio=3 -XX:TargetSurvivorRatio=80 -XX:MaxTenuringThreshold=8 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:MaxGCPauseMillis=10 -XX:GCPauseIntervalMillis=50 -XX:MaxGCMinorPauseMillis=7 -XX:+ExplicitGCInvokesConcurrent -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+BindGCTaskThreadsToCPUs -Xnoclassgc


Setting up:
Click the options in the launcher
Set the slider to 2.0GB
Copy the arguments above and paste them into additional JVM parameters under advanced options.
How They Work: In a Nutshell <<< Still in the process of writing this (this is for older arguments)
Use of these arguments are at the sole discretion of the end user and are provided as is on a “Use at your own risk” basis.
I (Eyamaz) am not responsible for any issues you may receive from using these arguments nor any damages that may incur during their use
whether that damage be physical, data, or any other form of loss such as your own sanity or your computer sparking to life and
eating your children.

These arguments are the products of independent research and not affiliated in any way with Feed The Beast
other than being hosted on its forums
.​
 
Last edited:

Vauthil

New Member
Jul 29, 2019
1,491
-14
1
I just did a ninja edit to address your smiley issue. There's some adjusted tweaks in here from what I use myself that I think I will give a whirl, too. =)
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
I just did a ninja edit to address your smiley issue. There's some adjusted tweaks in here from what I use myself that I think I will give a whirl, too. =)

Unfortunately if someone copy pastes it, java will through an exeption because it doesnt recognize "permSize" only "PermSize"
 

Vauthil

New Member
Jul 29, 2019
1,491
-14
1
Unfortunately if someone copy pastes it, java will through an exeption because it doesnt recognize "permSize" only "PermSize"

Fixed. Autoparser had no doubt lowercased them in previous iteration.

The trick, BTW, is to enclose the text you don't want bbcode/smiley parsed inside [plain] tags.
 
  • Like
Reactions: Eyamaz

Gerald Huppertz

New Member
Jul 29, 2019
196
0
0
I have a question. In many other threads I saw reference to adding the XMS, XMX and PermSize arguments to the ftb launcher. You do not seem to have them in your launcher config, only the server.
So do those arguments not help client side and are specific to the server?

Thanks
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
I have a question. In many other threads I saw reference to adding the XMS, XMX and PermSize arguments to the ftb launcher. You do not seem to have them in your launcher config, only the server.
So do those arguments not help client side and are specific to the server?

Thanks

These are already added by the ftb launcher.
 

unv_annihilator

New Member
Jul 29, 2019
45
0
0
I feel you might want to expand on/clarify how much ram you should allocate/your server's max ram, and also touch on the ReservedCodeCacheSize. It seems to be set the same as the Xmx and Xms, but you don't mention scaling or anything. Just a few thoughts though, awesome post none the less :)

-unv
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
I feel you might want to expand on/clarify how much ram you should allocate/your server's max ram, and also touch on the ReservedCodeCacheSize. It seems to be set the same as the Xmx and Xms, but you don't mention scaling or anything. Just a few thoughts though, awesome post none the less :)

-unv

I will be. I guess I can add some notes after work today.
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
Updated with a little bit of information specific to Servers and my Recommended numbers. Also made the formatting prettier.
 

Baron

New Member
Jul 29, 2019
59
0
0
What do these lines do? Care to explain what each one does?
-XX:TargetSurvivorRatio=80
-XX:MaxTenuringThreshold=31
-XX:+UseG1GC -XX:MaxGCPauseMillis=40
-XX:GCPauseIntervalMillis=400
-XX:+TieredCompilation
-XX:ReservedCodeCacheSize=2048m
-XX:+UseCodeCacheFlushing
-XX:CompileThreshold=1000

Is this good for a server with 24GBs of ram?
java -server -Xincgc -Xmn6G -Xms24G -Xmx24G -XX:permSize=1024m -XX:MaxPermSize=2048m -XX:+DisableExplicitGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:MaxGCPauseMillis=40 -XX:GCPauseIntervalMillis=400 -XX:+UseAdaptiveGCBoundary -XX:+UseCMSCompactAtFullCollection -XX:parallelGCThreads=8 -XX:MaxTenuringThreshold=30 -XX:UseSSE=4 -XX:+UseLargePages -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:ReservedCodeCacheSize=2048m -XX:+UseCompressedOops -XX:CMSFullGCsBeforeCompaction=1 -XX:+OptimizeStringConcat -Xnoclassgc -oss4M -ss4M -XX:+AggressiveOpts -jar JARHERE.jar nogui
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
What do these lines do? Care to explain what each one does?
-XX:TargetSurvivorRatio=80
-XX:MaxTenuringThreshold=31
-XX:+UseG1GC -XX:MaxGCPauseMillis=40
-XX:GCPauseIntervalMillis=400
-XX:+TieredCompilation
-XX:ReservedCodeCacheSize=2048m
-XX:+UseCodeCacheFlushing
-XX:CompileThreshold=1000

Is this good for a server with 24GBs of ram?
java -server -Xincgc -Xmn6G -Xms24G -Xmx24G -XX:permSize=1024m -XX:MaxPermSize=2048m -XX:+DisableExplicitGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:MaxGCPauseMillis=40 -XX:GCPauseIntervalMillis=400 -XX:+UseAdaptiveGCBoundary -XX:+UseCMSCompactAtFullCollection -XX:parallelGCThreads=8 -XX:MaxTenuringThreshold=30 -XX:UseSSE=4 -XX:+UseLargePages -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:ReservedCodeCacheSize=2048m -XX:+UseCompressedOops -XX:CMSFullGCsBeforeCompaction=1 -XX:+OptimizeStringConcat -Xnoclassgc -oss4M -ss4M -XX:+AggressiveOpts -jar JARHERE.jar nogui

I will be writing up an actual article explaining what they all do in time. after a month of researching all the things, im taking a break. as for your flags. use the ones ive provided for servers and dont add anything to them. use -Xms16G -Xmx16G -Xmn4G. NEVER set a MaxPermSize you may find yourself with OutOfMemory:permGen errors.

-XX:+UseCompressedOops -- is alread on by default in 64bit java. this is redundant.
-XX:UseSSE=4 -- Minecraft is not coded to take advantage of the extra abilities of SSE 4 this is software coding dependent. pointless to use.
-XX:+UseLargePages -- slows down garbage collection
-XX:+UseFastAccessorMethods -- made no change in my performance testing
-XX:+UseStringCache -- makes no impact because im already forcing objects to stay in memory longer
-XX:+OptimizeStringConcat -- IIRC this was removed in Java7
-XX:parallelGCThreads=8 -- java sets this automatically based on your CPU
"-Xincgc -XX:+DisableExplicitGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseAdaptiveGCBoundary -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=1" -- this is going to crap on your GC. your using THREE garbage collectors to do the work -XX:+UseG1GC does better by itself for what we want.
"-oss4M -ss4M" messing with thread stack size limits is silly unless you know the exact size you need for the largest thread. using jprofiler ive seen threads bigger than this. dont bother with this. java takes care of it fine.
-Xnoclassgc -- I'm still trying to see the actual impact of this. It has fixed performance in very specific instances and made it worse in other instances so i left it out of my recommended list for now.
-server -- 64bit java7 always runs in server mode. this is not needed.

Any more questions?
 

Laguy

New Member
Jul 29, 2019
43
0
0
Thanks for posting this info. If we are using the Minecraft 1.6.x launcher, which setting(s) should we be using.