What to do if you get 'Permgen space' crashes

MrBrunty

New Member
Jul 29, 2019
257
0
0
Ok so on the MCPC+ forums a lot of people have been posting errors similar to this one, so I figured I'd make a quick guide for the benefit of everyone so they don't spam the good people on these forums or mcpc+:

22:31:12 [INFO] Connection reset
22:31:31 [SEVERE] Exception in thread "Thread-6"
>
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-6"
22:31:49 [SEVERE] The server has stopped responding!
22:31:53 [SEVERE] Please report this to http://www.mcportcentral.co.za/
22:31:58 [SEVERE] Be sure to include ALL relevant console errors and Minecraft crash reports
22:32:03 [SEVERE] MCPC+ version: git-MCPC-Plus-jenkins-MCPC-Plus-Legacy-610 (MC: 1.5.2)
22:32:07 [SEVERE] Current Thread State:
22:32:10 [SEVERE] Exception in thread "Spigot Watchdog Thread"
>
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Spigot Watchdog Thread"

there are others but the key think to look for is 'Permgen'

This will occur if you have updated to the lovely new unleashed pack and are using MCPC+ and the crashes will happen very frequently, but don't worry - easy fix =D

you should have a start command looking like this: java -Xms16G -Xmx16G -jar server.jar nogui

changing it to something like this will fix the issue:

Code:
java -Xmx16G -Xms16G -XX:PermSize=256M -XX:MaxPermSize=512M -jar server.jar nogui
make sure you have enough ram space afterwards as the perm size is in addition to the dedicated ram!

The bit in the brackets in that isn't needed but I am aparently special and couldn't find a way to turn off the smileys...
 

Athion

New Member
Jul 29, 2019
2
0
0
Hi my server is set to the exact code you gave above... yet i am still getting permgen errors. i am using the unleashed pack but with Gregtech added to it. should it be running fine?
 

Jared39

New Member
Jul 29, 2019
125
0
0
Hi my server is set to the exact code you gave above... yet i am still getting permgen errors. i am using the unleashed pack but with Gregtech added to it. should it be running fine?
The problem has to be elsewhere since I am running the same setup as you basicly but with the PermGen size at only 128M instead of 256M which is more than enough.
 

MrBrunty

New Member
Jul 29, 2019
257
0
0
The problem has to be elsewhere since I am running the same setup as you basicly but with the PermGen size at only 128M instead of 256M which is more than enough.
yea that is ample, I actually have mine at 512 and 1g for my server as I have a lot of excess ram, the default is only 8m and 16m which is just nowhere near enough
 

Jared39

New Member
Jul 29, 2019
125
0
0
yea that is ample, I actually have mine at 512 and 1g for my server as I have a lot of excess ram, the default is only 8m and 16m which is just nowhere near enough
Ah, yes, my machine only has 16GB ram and I am running more than just my FTB server so I have to be careful on how much RAM is used :p
 

Athion

New Member
Jul 29, 2019
2
0
0
yeah i have 3.5Gb of ram on my server.. my host wont let me change the permgen level as we use MCMyAdmin to control the script that starts up the server. so they tell me they have set it correct. As a test my server was set to the type: feed the beast which required the jar file to be named FTB-Beta-A.jar, i have now changed it to the type Tekkit which now runs a script (which im guessing would be a new one) asking for Tekkit.jar. if i get another permgen error i will open a ticket with them asking if the settings are still the same. if they say yes then they have either been lying to me or failing to put it in the correct place.
 

Dodge34

New Member
Jul 29, 2019
511
0
0
I'm currently trying to set the permsize of my own Multicraft server (my brother purchased a license for it and we're setting it up on his machine that he never ever use and he has 50mbps of upload speed so should work ok) now trying to find what I need to change for the permsize to be bigger in Multicraft its like asking a blind person to drive you home in your own car... There's support for Multicraft, but not for server admins, only for the users that have a server hosted on Multicraft which doesn't help at all since I already know everything about this and know there's no config files to change there, it must be on the Multicraft part that there's something to change, but what exactly, that's the question.
 

MrBrunty

New Member
Jul 29, 2019
257
0
0
I don't use multicraft so I couldn't speculate very well. However in your server folder should be a start file which is executed when you press the start button. It will most liekly be something like:

serverstart.sh
serverstart.bat

The extensions are the most important things to look for

To be honest your best option would be to simply use an ssh screen to run your server, It is a lot easier to manage, and works a lot better than multi craft
 

Dodge34

New Member
Jul 29, 2019
511
0
0
I seriously need something that doesn't require command lines and such, I've figured out by a post that the file I need to edit is something like a .conf file in the Multicraft default jar directory where he put all the jar to download for the users (and not the minecraft server directory where we also can have a custom jar folder which is another story) but still I'm not 100% sure how to edit and what to edit to make it work, will have to figure this out tomorrow.
 

elcid534

New Member
Jul 29, 2019
44
0
0
their isnt a .conf or .cfg or any other type of configuation file, what you are looking for is the startup script and you want to add these lines to the startup script. this can be startup.bat, startup.sh or pritty much anyname followed by .sh/.bat.

then you are looking for the
Code:
java -Xmx1G -Xms2G  -jar server.jar nogui
and wanna change it to
Code:
java -Xmx1G -Xms2G -XX:PermSize=256M -XX:MaxPermSize=512M -jar server.jar nogui
the script will be most likely in the root of the server, however when using some of those server hosting solutions adding addidional arguments to the startup script can be troublesom to impossible. ask their support line if you are unsure.

im using the ftb launcher and getting this error with the 1.1.2 internal server, so to fix with ftb launcher goto the options tab, then advanced options, and in the "additional arguments" slot add
Code:
-XX:PermSize=256M -XX:MaxPermSize=512M
p.s i know this is my first post, but please dont treat what ive said as crap just cus of that

p.s.s after adding the options to my launcher i cna finally go all the way through the nei list without crashing, and i dont seem to be having any issue so JOB WELL DONE MrBrunty!
 

Siro

New Member
Jul 29, 2019
638
0
0
I seriously need something that doesn't require command lines and such, I've figured out by a post that the file I need to edit is something like a .conf file in the Multicraft default jar directory where he put all the jar to download for the users (and not the minecraft server directory where we also can have a custom jar folder which is another story) but still I'm not 100% sure how to edit and what to edit to make it work, will have to figure this out tomorrow.
Once you find the .jar.conf files in the jar folder, you need to look for this line:
Code:
command = "{JAVA}" -Xmx{MAX_MEMORY}M -Xms{START_MEMORY}M -Djline.terminal=jline.UnsupportedTerminal -Duser.language=en -Duser.country=US -jar "{JAR}" nogui --nojline --log-strip-color true
and change it to something like this:

Code:
command = "{JAVA}" -Xmx{MAX_MEMORY}M -Xms{START_MEMORY}M -XX:permSize=256M -XX:MaxPermSize=512M -Djline.terminal=jline.UnsupportedTerminal -Duser.language=en -Duser.country=US -jar "{JAR}" nogui --nojline --log-strip-color true
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
MaxPermSize is bad. Do not set it. See my tech support post on JVM arguments. The link is in my signature.
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
Just MaxPermSize. It can cause OOM if to many classes are loaded in the PermGen.
 

MrBrunty

New Member
Jul 29, 2019
257
0
0
having 5 GB of ram and not having a cap can also lead to OOM errors if you have 4.5GB dedicated to standard RAM, perm size will go into that if it is unused, if it is then needed, boom OOM error. When you have a lot of memory yes, don't bother, but I wrote this post for the community and the majority of them don't have a ton of RAM at their disposal
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
The JVM needs 3GB of RAM over what is set in the Heap (your Xmx value) 2GB for the CodeCache and about 1GB for PermGen. These two areas are where all the compiled and interpreted code are. I state that in part of my tech support post I made that's link in my signature.