2014-03-09 22:14:45 +00:00
From a860de9391355dcef67a2f679c316542a5d97608 Mon Sep 17 00:00:00 2001
2013-12-23 03:08:28 +00:00
From: md_5 <git@md-5.net>
Date: Mon, 23 Dec 2013 14:07:41 +1100
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
2014-02-12 13:48:26 +00:00
index 8d127fb..062dbec 100644
2013-12-23 03:08:28 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
2014-02-12 13:48:26 +00:00
@@ -155,6 +155,22 @@ public class Main {
2013-12-23 03:08:28 +00:00
useConsole = false;
}
+ // Spigot Start
2013-12-28 23:54:44 +00:00
+ int maxPermGen = 0; // In kb
2013-12-23 03:08:28 +00:00
+ for ( String s : java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments() )
+ {
+ if ( s.startsWith( "-XX:MaxPermSize" ) )
+ {
+ maxPermGen = Integer.parseInt( s.replaceAll( "[^\\d]", "" ) );
2013-12-28 23:54:44 +00:00
+ maxPermGen <<= 10 * ("kmg".indexOf( Character.toLowerCase( s.charAt( s.length() - 1 ) ) ) );
2013-12-23 03:08:28 +00:00
+ }
+ }
2013-12-28 23:54:44 +00:00
+ if ( maxPermGen < (128<<10) ) // 128mb
2013-12-23 03:08:28 +00:00
+ {
+ 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" );
2014-01-28 17:51:26 +00:00
+ System.out.println( "Please see http://www.spigotmc.org/wiki/changing-permgen-size/ for more details and more in-depth instructions." );
2013-12-23 03:08:28 +00:00
+ }
+ // Spigot End
System.out.println("Loading libraries, please wait...");
MinecraftServer.main(options);
} catch (Throwable t) {
--
2014-03-09 21:37:28 +00:00
1.8.3.2
2013-12-23 03:08:28 +00:00