From 16467dc1484acf41e33e2b99b3e448c0f738d89c Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 23 Dec 2013 14:08:28 +1100 Subject: [PATCH] Warn if PermGen may be insufficient. Since 1.7 Mojang added a lot of new classes to their jar. This, coupled with plugins, may cause the loaded classes to exceed the default perm gem of 64mb. As such we will print a small warning advising users to set a higher PermGen if they haven't already. --- ...-Warn-if-PermGen-may-be-insufficient.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 CraftBukkit-Patches/0084-Warn-if-PermGen-may-be-insufficient.patch diff --git a/CraftBukkit-Patches/0084-Warn-if-PermGen-may-be-insufficient.patch b/CraftBukkit-Patches/0084-Warn-if-PermGen-may-be-insufficient.patch new file mode 100644 index 0000000000..9f2bb4f166 --- /dev/null +++ b/CraftBukkit-Patches/0084-Warn-if-PermGen-may-be-insufficient.patch @@ -0,0 +1,34 @@ +From 1fdd743f7d9574e16efdc4831324a18d7847dc47 Mon Sep 17 00:00:00 2001 +From: md_5 +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 +index 07c26f1..9952087 100644 +--- a/src/main/java/org/bukkit/craftbukkit/Main.java ++++ b/src/main/java/org/bukkit/craftbukkit/Main.java +@@ -149,6 +149,20 @@ public class Main { + useConsole = false; + } + ++ // Spigot Start ++ int maxPermGen = 0; ++ for ( String s : java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments() ) ++ { ++ if ( s.startsWith( "-XX:MaxPermSize" ) ) ++ { ++ maxPermGen = Integer.parseInt( s.replaceAll( "[^\\d]", "" ) ); ++ } ++ } ++ if ( maxPermGen < 128 ) ++ { ++ 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" ); ++ } ++ // Spigot End + System.out.println("Loading libraries, please wait..."); + MinecraftServer.main(options); + } catch (Throwable t) { +-- +1.8.3.2 +