Changing PermGen Size

Mar 10, 2016
Changing PermGen Size
  • Changing PermGen Size

    Preventing crashes and GC spikes



    Important: In Java 8, support for PermGen was removed.

    Background
    With the 1.7 update, Mojang added several libraries to the Minecraft server, resulting a quite a few more classes and a much higher PermGen usage as a result. In order to run your server optimally and to prevent crashes, we recommend you increase your PermGen allocation in the JVM to prevent these issues

    Support for PermGen was removed in Java 8.0 due to the creation of dynamically allocated metaspace. As a result, you will not need to take heed of this and should not run into any related issues, unless you run out of heap space.

    Method
    First, open your startup command or startup file in a text editor of your choice. It should look similar to:

    <path to java executable // java> -Xms1G -Xmx2G -<extra flags> -jar spigot.jar nogui

    In order to change your PermGen allocation,you need to add the flag -XX:MaxPermSize=128M into this command. It needs to be after you the java command but before your -jar flag. For example:

    <path to java executable // java> -Xms1G -Xmx2G -XX:MaxPermSize=128M -<extra flags> -jar spigot.jar nogui

    Once you restart your server and run the command to start it, you will now have allocated more PermGen space, and as a result, you will be able to run more plugins.

    For alternate wrappers
    • If you're using McMyAdmin, put -XX:MaxPermSize=128M in the Java.CustomOpts setting in McMyAdmin.conf
    • If you're using mark2, put java.cli.XX.MaxPermSize=128M in your mark2.properties.
    • If you're using Multicraft, review their documentation for a configuration suitable for Spigot.
    • If you're using Rtoolkit, open "wrapper.properties" in the toolkit folder. Then add ",-XX:MaxPermSize=128M" to "extra-runtime-arguments". Restart the wrapper to apply these changes.
  • Loading...
  • Loading...