2014-01-28 18:51:26 +01:00
From 8419a2d0a468dd909b42f8d81b415d2945765827 Mon Sep 17 00:00:00 2001
2013-12-23 04:08:28 +01: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-01-28 18:51:26 +01:00
index 07c26f1..246e641 100644
2013-12-23 04:08:28 +01:00
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
2014-01-28 18:51:26 +01:00
@@ -149,6 +149,22 @@ public class Main {
2013-12-23 04:08:28 +01:00
useConsole = false;
}
+ // Spigot Start
2013-12-29 00:54:44 +01:00
+ int maxPermGen = 0; // In kb
2013-12-23 04:08:28 +01:00
+ for ( String s : java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments() )
+ {
+ if ( s.startsWith( "-XX:MaxPermSize" ) )
+ {
+ maxPermGen = Integer.parseInt( s.replaceAll( "[^\\d]", "" ) );
2013-12-29 00:54:44 +01:00
+ maxPermGen <<= 10 * ("kmg".indexOf( Character.toLowerCase( s.charAt( s.length() - 1 ) ) ) );
2013-12-23 04:08:28 +01:00
+ }
+ }
2013-12-29 00:54:44 +01:00
+ if ( maxPermGen < (128<<10) ) // 128mb
2013-12-23 04:08:28 +01: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 18:51:26 +01: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 04:08:28 +01:00
+ }
+ // Spigot End
System.out.println("Loading libraries, please wait...");
MinecraftServer.main(options);
} catch (Throwable t) {
--
2014-01-22 09:19:39 +01:00
1.8.3.2
2013-12-23 04:08:28 +01:00