4

I have a FTB Unleashed 1.1.7 server running and I have been getting the following error as of lately "java.lang.OutOfMemoryError: PermGen space".

According to this thread: Dealing with “java.lang.OutOfMemoryError: PermGen space” error , the recommended flags are

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled along with setting the MaxPermSize -XX:MaxPermSize=128M.

What is the ideal MaxPermSize? Will increasing the MaxPermSize (256mb, 512mb) degrade performance?

1
  • 1
    For future reference: as of Java 8, the permanent generation has been removed. If finding the right MaxPermSize is causing trouble, an upgrade to Java 8 may help.
    – JvR
    Commented Aug 1, 2014 at 16:01

5 Answers 5

1

While I do agree to some point with the existing answers, increasing to -XX:MaxPermSize=512M will help and even up to -XX:MaxPermSize=1G should not hurt, assuming your server has that amount of physical RAM, a word of advice regarding the total heap size, which is configured by increasing -Xmx=xGB.

In general this will increase the available memory for the program, which is good, since the JVM (Java Virtual Machine, essentially the program running your minecraft server) will have more memory to put 'stuff' into. At a certain point, there will however be a great drawback. As you go into the 10s of gigabytes, the JVM becomes more and more inefficient to handle this much memory without advice.

As more and more memory is needed, you need to tell the JVM what exactly the memory is primarily used for (this depends weather your java objects are rather short- or long-lived). I am not sure regarding how Minecraft handles this memory, as I come from another java field (J2EE), but the bigger the total RAM, the more likely you need to tune your server to the specific requirement for the application.

Specifically you will need to tune the garbage collector to rather have minimal stop-the-world pauses (basically where your server completely stands still and seemingly does nothing). Using -XX:+UseConcMarkSweepGC will help that a lot. Using -XX:CMSClassUnloadingEnabled will only help to keep your PermGen (-XX:MaxPermSize) clean but not keeping your overall heap clean. For the former case, there are literally dozens of settings that need to be considered.

TL;DR:

For a very big server there is a lot more to tune than just the -XX:MaxPermSize. A PermSize of around -XX:MaxPermSize=1G and a heap around -Xmx=4G to -Xmx=6G should still be fairly safe. I would not go much beyond this to keep server performance.

Of course the MaxPermSize + Xmx should never be higher than the RAM installed in your computer. It will start swapping which will reduce performance by some magnitudes.

0

If you are running the server off of a house computer, or a host server that uses individual PCs, increasing the MaxPermSize will do quite the opposite of degrading performance, it will increase the performance of the server from not too much improvement to a drastic improvement, based on what the PC is build with. only performance that might degrade is your personal client, if you are running the server off the same computer.

0

In my experience (aka, this is anecdotal) my FTB Ultimate (and now TPPI) servers will fall over pretty quick at a maxpermsize of 128. I consider 256 the minimum for the very large packs like Ultimate and TPPI. I run both my client and my server at 512, but I also have plenty of memory to spare (96gb on the server, 32 on my client).

If you're tight on memory, bump it to at least 256 and you should be ok. It looks like at this point, you don't really have much of an option anyhoo. If you can, throwing it up to 512mb would be my recommendation and there will be no negative performance impact unless you're hitting the limit on your available memory to the system or the process (java).

0

The option -XX:+CMSPermGenSweepingEnabled was removed in Java 6 so there is no reason to include the option. The new option -XX:CMSClassUnloadingEnabled effectively replaces the CMSPermGenSweeping in all versions from 6 up. In order to see the benefits from though you need to also include the option -XX:+UseConcMarkSweepGC.

As far as -XX:MaxPermSize=128m as long as you have enough memory available then there should be no problems with performance if you increase this to 256M or 512M. As far a normal memory allocation goes, to try prevent crashes, you could allocated your max memory to java to leave a "reserve" space of memory. For example a server with 8 GB of memory you would launch with -Xmx7G.

Sample launch flags:

-Xmx7G -XX:MaxPermSize=256M -XX:+UseConcMarkSweepGC XX:+CMSClassUnloadingEnabled

0

For your question use the java arguments -Xms1012M -Xmx4048 -XX:MaxPermSize=512M -XX:+UseConcMarkSweepGC XX:+CMSClassUnloadingEnabled

(use that if you have 6-8 GB'S of ram)

For 3-6 GB'S use this

-Xms512M -Xmx2024 -XX:MaxPermSize=256M -XX:+USeConcMarkSweepGC XX:+CMSClassUnloadingEnabled

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .