Java 8 - Cannot use large Page memory!

Discussion in 'Bukkit Help' started by killerline10168, May 7, 2014.

?

Do you think Java 8 was a good update?

  1. Yes

    2 vote(s)
    33.3%
  2. Sort of...

    3 vote(s)
    50.0%
  3. Nope!

    1 vote(s)
    16.7%
Thread Status:
Not open for further replies.
  1. Offline

    killerline10168

    Hay! I recently downloaded Java 8 (64 bit) and when i start my server i get
    "Java HotSpot(TM) 64-Bit Server VM warning: JVM cannot use large page memory because it does not have enough privilege to lock pages in memory.".
    What should i do? And if they mean pagefile I've got 24 gb on my hdd (my server and windows is on a ssd). Any ideas?
     
  2. Offline

    Hoolean Retired Staff

    Hey there, can I see your startup script please? :)
     
  3. Offline

    Bobcat00

  4. Offline

    killerline10168

    My start.bat:
    Code:java
    1. [USER=90997314]@Echo[/USER] OFF
    2. TITLE SpigiesMC
    3. START "SpigiesMC" /ABOVENORMAL /B java -server -Xmx8G -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseNUMA -XX:+CMSParallelRemarkEnabled -XX:MaxGCPauseMillis=50 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -XX:UseSSE=3 -XX:+UseLargePages -XX:+UseFastAccessorMethods -XX:+UseCompressedOops -XX:+OptimizeStringConcat -XX:+AggressiveOpts -jar craftbukkit.jar nogui

    I got the code from the forums, here, got it from Phaedrus " https://forums.bukkit.org/threads/how-can-i-optimize-java-on-my-server.3967/page-3 "

    I thought the same as you but then i reminded myself that i downloaded Java 8 for a reason! Better performance! So I'll not give up that easy ;)

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

    Bobcat00

    You've got to be f-in kidding me. Do you really understand what each of those options do? Really? Why would you use all of them, because some web site said so? Don't you think if they were a good idea, they'd be the default options?
     
  6. Offline

    Hoolean Retired Staff

    killerline10168

    "-XX:+UseLargePages" is causing the problem. You must either run the server with administrator privileges or remove the offending option and any relating to it :)
     
  7. Offline

    killerline10168

    Oh, well thank you fellow! But my server won't be using page file (memory) anymore? :(

    EDIT: Do you know which of the flags (arguments) is a garbage collector? (that makes log files) because the server's going to crap my pc out after a while or two XD
     
  8. Offline

    LHammonds

    Try it with just the following 3 X options and see if it works well for you. Keep in mind that the server needs to be scheduled to reboot at least once per day.

    Code:
    "C:\Program Files\Java\jre8\bin\java.exe" -XX:MaxPermSize=128M -Xmx8192M -Xms8192M -jar craftbukkit.jar nogui
    Notice how I called the java 8 executable directly. This ensures the right version of java is selected no matter how your environment pathing is setup. So if you have Java 6, 7 and 8 with 32-bit and 64-bit versions all on your system, calling the java executable directly will ensure your 64-bit version of java 8 will be used.

    LHammonds
     
  9. Offline

    Bobcat00

    Since you obviously don't know what these options do, you should not be using them.

    EDIT: Garbage collector? Log files? What, exactly, are you concerned about?
     
  10. Offline

    LHammonds

    My guess is that he is using heavy plugin(s) that is lagging his server and is looking for a quick-fix / band-aid approach to resolve it...which isn't gonna happen. If there are performance issues, you have to identify and address the root cause. Anything else is just a band-aid solution and will not make the problem go away.
     
  11. Offline

    killerline10168

    Thanks ;) !

    I'm not concerned... But i just don't want log files in my hard drive =/
    No, i just removed everything in my server folder (except for world( to clean it up, actually... It's i don't want spammed log files in my ssd

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

    Bobcat00

    NONE of the options you were using have to do with log files, but they do have the potential to mess up your server. Want to change the log file behavior, see this:
    http://forums.bukkit.org/threads/log-file-format-log4j2.209002/
     
  13. Offline

    LHammonds

    Do you have an non-ssd drive? Put Minecraft on it. Log files are essential to troubleshooting problems.
     
  14. Offline

    killerline10168

    For the first, why are you so upset that i have flags >;/ , many people get 50% better performance using them! And for the second, flags can't be that bad, can they? And for the third, Java 8 has stopped supporting max/perm size so no need to bother anymore :)
    Yes, i have and why should i put minecraft on it? Isn't minecraft faster on a ssd? And my server is on the ssd, but i'm thinking of putting it on a RAMdisk, what do you guys say?
     
  15. Offline

    Bobcat00

    I'm outahere.
     
  16. Offline

    LHammonds

    Well, I was assuming you wanted to prevent a ton of writes to your SSD drive. There were concerns with early SSDs about limiting the amounts of automated writes to a system to prolong SSD lifespan. If that is not your concern and you have a newer SSD, I'm confused why you care about the log files. Are you wanting to make sure they are purged and not ever-growing? That can be done using the solution bobcat pointed out or using your batch file that starts minecraft and have it purge files older than "X" amount of days...or all log files if you like.

    As for RAMDisc, that has not been recommended since the days of 1.2.5. Mojang cleaned up their file handling so RAMDisks are no longer mandatory for performance. :) I used to use one but it became unnecessary in 1.3 and above. In fact, it is more of a liability than a benefit and can be a real headache to manage over time. For example, you have to use WorldBorder to guarantee the growth of your world files are limited to not exceed your RAMdisc size. Also not to mention the woes a server crash, power failure or improper shutdown can cause.

    Yep, I think we've said all we need to say at this point. :)

    LHammonds
     
  17. Offline

    killerline10168

    Ok, thanks for everything! But one last thing... Can you make a useful "start.bat" file for me? People seems to hate me because of the one i use 0_0

    PS. I've got an Samsung 840 EVO 250GB 2.5 inch Dekstop kit
     
  18. Offline

    Lolmewn Retired Staff

  19. Offline

    LHammonds

    I don't think anyone hates you regarding your batch file. Over use of java parameters you don't understand can sound silly but I'm sure it isn't hate. The 50% increase in performance is quite funny too. :p

    Here is a batch file I've used for a couple years now tailored to include support for Java 1.8 which I will start to use from this point forward (the batch file, not 1.8). If you have various versions of Java installed, it will prefer Java 8, then 7, then 6 and then prefer 64-bit over 32-bit but will use whatever is available. It all assumes you installed Java to the default folder though.

    Just be sure to set the correct server path on line #4

    start-server.bat
    Code:
    @ECHO OFF
    TITLE SpigiesMC
    SET RAM2USE=8192
    CD /D C:\CraftBukkit
     
    REM ** Look for a version of Java 8 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
    IF EXIST "%ProgramFiles%\Java\jre8\bin\java.exe" GOTO JAVA8DEFAULT
     
    REM ** Look for 32-bit version of Java 8 on 64-bit OS **
    IF EXIST "%ProgramFiles(x86)%\Java\jre8\bin\java.exe" GOTO JAVA832BIT
     
    REM ** Look for a version of Java 7 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
    IF EXIST "%ProgramFiles%\Java\jre7\bin\java.exe" GOTO JAVA7DEFAULT
     
    REM ** Look for 32-bit version of Java 7 on 64-bit OS **
    IF EXIST "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" GOTO JAVA732BIT
     
    REM ** Look for a version of Java 6 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
    IF EXIST "%ProgramFiles%\Java\jre6\bin\java.exe" GOTO JAVA6DEFAULT
     
    REM ** Look for 32-bit version of Java 6 on 64-bit OS **
    IF EXIST "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" GOTO JAVA632BIT
     
    :JAVA8DEFAULT
    REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 8 **
    REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 8 **
    "%ProgramFiles%\Java\jre8\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
     
    :JAVA832BIT
    REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 8 **
    "%ProgramFiles(x86)%\Java\jre8\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
     
    :JAVA7DEFAULT
    REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 7 **
    REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 7 **
    "%ProgramFiles%\Java\jre7\bin\java.exe" -XX:MaxPermSize=128M -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
     
    :JAVA732BIT
    REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 7 **
    "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -XX:MaxPermSize=128M -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
     
    :JAVA6DEFAULT
    REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 6 **
    REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 6 **
    "%ProgramFiles%\Java\jre6\bin\java.exe" -XX:MaxPermSize=128M -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
     
    :JAVA632BIT
    REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 6 **
    "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -XX:MaxPermSize=128M -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar nogui
    GOTO DONE
     
    :DONE
    REM ** This will pause the screen so you can see any error messages after stopping the CraftBukkit server. **
    PAUSE
    
     
Thread Status:
Not open for further replies.

Share This Page