Don't print permgen warning for java 8+

This commit is contained in:
md_5 2014-03-23 11:20:02 +11:00
parent 69324bba91
commit c9605032d0

View file

@ -1,11 +1,11 @@
From a860de9391355dcef67a2f679c316542a5d97608 Mon Sep 17 00:00:00 2001 From 4f38a35da6cf609f852bae50e5b9102c21f71ddf Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net> From: md_5 <git@md-5.net>
Date: Mon, 23 Dec 2013 14:07:41 +1100 Date: Mon, 23 Dec 2013 14:07:41 +1100
Subject: [PATCH] Warn if PermGen may be insufficient Subject: [PATCH] Warn if PermGen may be insufficient
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 8d127fb..062dbec 100644 index 8d127fb..008e037 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -155,6 +155,22 @@ public class Main { @@ -155,6 +155,22 @@ public class Main {
@ -22,7 +22,7 @@ index 8d127fb..062dbec 100644
+ maxPermGen <<= 10 * ("kmg".indexOf( Character.toLowerCase( s.charAt( s.length() - 1 ) ) ) ); + maxPermGen <<= 10 * ("kmg".indexOf( Character.toLowerCase( s.charAt( s.length() - 1 ) ) ) );
+ } + }
+ } + }
+ if ( maxPermGen < (128<<10) ) // 128mb + if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 52 && maxPermGen < ( 128 << 10 ) ) // 128mb
+ { + {
+ System.out.println( "Warning, your max perm gen size is not set or less than 128mb. It is recommended you restart Java with the following argument: -XX:MaxPermSize=128M" ); + System.out.println( "Warning, your max perm gen size is not set or less than 128mb. It is recommended you restart Java with the following argument: -XX:MaxPermSize=128M" );
+ System.out.println( "Please see http://www.spigotmc.org/wiki/changing-permgen-size/ for more details and more in-depth instructions." ); + System.out.println( "Please see http://www.spigotmc.org/wiki/changing-permgen-size/ for more details and more in-depth instructions." );