How can I optimize Java on my server?

Discussion in 'Bukkit Help' started by odielag, Feb 10, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    snizzle

    well interesting terms ur discussing about...
    i tried to set up my own server just for max5 players to have a bit fun with minecraft.
    my system is: QuadCore with 2,5GHz, 4GB Ram, Win7 Ultimate
    my server runs with these commands:
    Code:
    -Xms1G -Xmx1G -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+AgressiveOpts -XX:+ParallelGCThreads=3 -jar craftbukkit.jar
    and its working really good. but i try to get a bit more performance (without buying a new pc) and maybe less CPU usage.
    so i tried out this:
    Code:
    -Xms1G -Xmx1G -XX:PermSize=128m -XX:MaxPermSize=256m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:ParallelGCThreads=3 -XX:MaxGCPauseMillis=5 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -Xnoclassgc -XX:UseSSE=3 -XX:+UseLargePages -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:+UseCompressedStrings -XX:+OptimizeStringConcat -XX:+AggressiveOpts -jar craftbukkit.jar
    but nothing happens. after using the bat file the cmd pops up for a milli sec and than nothing...
    can anyne help me pls?!
    iam not really skilled in this...
     
  2. Offline

    Phaedrus

    There is an argument that java doesn't like. To find out which one, we need the command window to stay open instead of instantly closing. To do this, add PAUSE to a new line at the bottom of your batch file. That way, when you run it, it will pause after it fails and you'll be able to see what the error msg is.
     
  3. Offline

    snizzle

    Unrecognized VM option `+OptimizeStringConcat`
    Could not create the Java Virtual Machine


    thats what appears in the window...
     
  4. Offline

    Phaedrus

    Either update your java to the latest 1.6 64bit release or remove that argument from the line and it should start.
     
  5. Offline

    snizzle

    java is on the latest update and i removed the command.
    now the cmd shos up this: error occured during initialization of VM missed java implementation of Compressed Strings

    edit: ok got the problem, i had to remove -XX:+UseStringCache -XX:+UseCompressedStrings also ...
    and i tested the differences of running the server normal and with these commands. no big difference on my server with <5 clients connected.
     
  6. Offline

    Phaedrus

    What versiOn of java are you using exactly? Are you using 64-bit win7?

    Odd that those arguments wouldn't be usable.
     
  7. Offline

    snizzle

    latest java version u can download from the java HP. i think it was 1.6 update 24.
    and yes it is vista ulti x64.
     
  8. Offline

    Phaedrus

    Vista or windows 7?
    That might be the key factor.
     
  9. Offline

    snizzle

    oh damn my fault. its win7 ultimate x64.
     
  10. Offline

    Phaedrus

    Then I'm not sure since your setup seems the same as mine.

    Are you running as admin?
     
  11. Offline

    snizzle

    yes iam running as admin.
    used ram is 400mb and cpu usage about 28% for the minecraft server if 2 members are online. and running the server + commands doesnt change anything. same ram and cpu usage, same game performance.
     
  12. Offline

    Phaedrus

    Well that's a pretty low usage scenario. Might be more noticeable if you had a dozen users and a ton of plugins.
     
  13. Offline

    jeffreylec

    http://pastie.org/1820559 -- My CPU -- Yet I get lag with this start up script -- http://pastie.org/1820565 -- with 6-10 people on.. so strange.. anyhelp from anyone? I get the stupid "Cant keep up!" messages aswell

    halp pls.

    I am using Sun Java 1.7

    I guess I should look up the new 1.7 garbage collectors.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  14. Offline

    Phaedrus

    Have you tried the arguments I posted?
     
  15. Offline

    jeffreylec

    No, which post #? There are quite a few.

    Code:
    #! /bin/sh
    BINDIR="$(dirname "$(readlink -fn "$0")")"
    cd "$BINDIR"
    java -Xincgc -Xmx2g -jar craftbukkit-0.0.1-SNAPSHOT.jar nogui
     
  16. Offline

    Phaedrus

  17. Offline

    snizzle

    u got ram monitor or anything else to watch if maybe the ram is full?
     
  18. Offline

    pomo4ka

    Hi, please help with the choice of launch configuration.
    1. Intel @Xeon - 2 kernel;
    2. 4GB on the machine, 2GB Server;
    3. Linux (Ubuntu Server);
    4. OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1~10.04.1);
    5. OpenJDK Client VM (build 19.0-b09, mixed mode, sharing);
    6. Online: 20-50.
    Thank you.
     
  19. Offline

    Phaedrus

    pomo4ka likes this.
  20. Offline

    pomo4ka

  21. Offline

    Phaedrus

    Try this:
    Code:
    -Xmx2G -XX:PermSize=128m -XX:MaxPermSize=256m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:ParallelGCThreads=3 -XX:MaxGCPauseMillis=5 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -Xnoclassgc -XX:UseSSE=3 -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:+UseCompressedStrings -XX:+OptimizeStringConcat -XX:+AggressiveOpts -jar craftbukkit.jar
    
    It would help to know more information about your setup. And what the error message is when it fails to start.
     
  22. Offline

    pomo4ka

    I use Remote Toolkit. Where do I write it?
     
  23. Offline

    Phaedrus

  24. Offline

    vYN

    i'm using McMyAdmin.. so i'm just going to add my start arguments to "javaopts="
    and should it be formated like this:
    Code:
    -XX:PermSize=128m -XX:MaxPermSize=256m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:ParallelGCThreads=2 -XX:MaxGCPauseMillis=5 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -Xnoclassgc -XX:UseSSE=3 -XX:+UseLargePages -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:+UseCompressedStrings -XX:+OptimizeStringConcat -XX:+AggressiveOpts
     
  25. Offline

    Phaedrus

    yup, that should work.
     
  26. Offline

    JohnEBH

    Hi! I'd also like help with optimizing my server.

    Intel Core i7 920 @ 3.2Ghz
    12GB on machine 4-6GB for server
    Windows 7 Ultimate SP1 64Bit
    Java 1.6 Update 26 64Bit - Should I upgrade to 1.7? And where can I download?
    I also run a 1GB RAMDisk
     
  27. Offline

    Phaedrus

  28. Offline

    JohnEBH

    What exactly do I copy? When I launch it, the cmd pops up but then disappears.
    Running Bukkit 860
    Code:
    (AT) Echo OFF
    TITLE MINECRAFT-CRAFTBUKKIT
    START "MINECRAFT-CRAFTBUKKIT" /ABOVENORMAL /B java -server -Xms4G -Xmx6G -XX:PermSize=128m -XX:MaxPermSize=256m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:ParallelGCThreads=3 -XX:MaxGCPauseMillis=5 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -Xnoclassgc -XX:UseSSE=3 -XX:+UseLargePages -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:+UseCompressedStrings -XX:+OptimizeStringConcat -XX:+AggressiveOpts -jar craftbukkit-0.0.1-SNAPSHOT.jar nogui
    That's what I copied.
     
  29. Offline

    Phaedrus

    Change the (at) to @ and then add another line at the bottom with pause on it
     
  30. Offline

    JohnEBH

    Ty! It's working now, also I get this error at the start of the cmd:

    Code:
    Press any key to continue . . . Java HotSpot(TM) 64-Bit Server VM warning: JVM c
    annot use large page memory because it does not have enough privilege to lock pa
    ges in memory.
    And when I launch it as administrator it gives me this:

    Code:
    Press any key to continue . . . Unable to access jarfile craftbukkit-0.0.1-SNAPS
    HOT.jar
    Any ideas?
     
Thread Status:
Not open for further replies.

Share This Page