1. This section of the forums is now closed. You can post and answer support requests on the new support site here

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

Discussion in '[Archived] Tech Support' started by Eyamaz, Aug 13, 2013.

  1. Eyamaz

    Eyamaz Over-Achiever Team Member FTB Pack Developer FTB Modpack Team

    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: Mar 11, 2014
  2. Lawbroken

    Lawbroken . Team Member Global Moderator

    :P I think this will be really helpful
    Keep it updated and I shell leave it as a sticky for others to see.
     
  3. Vauthil

    Vauthil Runs With Scissors Team Member Global Moderator

    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. =)
     
  4. Eyamaz

    Eyamaz Over-Achiever Team Member FTB Pack Developer FTB Modpack Team

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

    Vauthil Runs With Scissors Team Member Global Moderator

    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.
     
    Eyamaz likes this.
  6. Ashzification

    Ashzification Over-Achiever

    If this isn't stickied it should be ;)
     
    Mashy14, Albeleo and PeggleFrank like this.
  7. Gerald Huppertz

    Gerald Huppertz Active Member

    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
     
  8. Ashzification

    Ashzification Over-Achiever

    Also, with your permission, I'd like to put this on the help desk KB as well :)
     
    Eyamaz likes this.
  9. Eyamaz

    Eyamaz Over-Achiever Team Member FTB Pack Developer FTB Modpack Team

    These are already added by the ftb launcher.
     
  10. Eyamaz

    Eyamaz Over-Achiever Team Member FTB Pack Developer FTB Modpack Team

    Link it, as I may update and change things. I will also eventually add links to my pastebin account when I finish writing how it all works.
     
  11. bambiiable

    bambiiable New Member

    *Kisses the Man * I Love you No Homo... just a little lol thank you so much
     
    Eyamaz likes this.
  12. Eyamaz

    Eyamaz Over-Achiever Team Member FTB Pack Developer FTB Modpack Team

    I see heph gave you the link. :p
     
    Mechwarr1214 likes this.
  13. unv_annihilator

    unv_annihilator Member Retired Staff

    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 and Lawbroken like this.
  14. Eyamaz

    Eyamaz Over-Achiever Team Member FTB Pack Developer FTB Modpack Team

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

    Eyamaz Over-Achiever Team Member FTB Pack Developer FTB Modpack Team

    Updated with a little bit of information specific to Servers and my Recommended numbers. Also made the formatting prettier.
     
  16. Baron

    Baron Member

    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
     
  17. Eyamaz

    Eyamaz Over-Achiever Team Member FTB Pack Developer FTB Modpack Team

    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?
     
  18. Baron

    Baron Member

    Thanks. Will let you know how my server does when I open it up to the public.
     
    Eyamaz likes this.
  19. bambiiable

    bambiiable New Member


    No I happened to see your twitter post instead hahah
     
    Eyamaz likes this.
  20. Laguy

    Laguy Member

    Thanks for posting this info. If we are using the Minecraft 1.6.x launcher, which setting(s) should we be using.
     

Share This Page