From 4ef6b15eb85c3d71d186eea20102e7cba45aa6cd Mon Sep 17 00:00:00 2001 From: lotus Date: Fri, 23 Jan 2009 15:13:09 +0000 Subject: [PATCH] limit -Xmx setting to 1999m on win32. bigger values would never work. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5513 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/PerformanceQueues_p.java | 9 ++++++--- source/de/anomic/server/serverSystem.java | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.java index 76b1a16da..118374727 100644 --- a/htroot/PerformanceQueues_p.java +++ b/htroot/PerformanceQueues_p.java @@ -37,6 +37,7 @@ import de.anomic.server.serverCore; import de.anomic.server.serverFileUtils; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; +import de.anomic.server.serverSystem; import de.anomic.server.serverThread; import de.anomic.tools.yFormatter; @@ -68,9 +69,11 @@ public class PerformanceQueues_p { if (post.containsKey("Xmx")) { int xmx = 120; // default maximum heap size try { xmx = Integer.valueOf(post.get("Xmx", "120")).intValue(); } catch (final NumberFormatException e){} - sb.setConfig("javastart_Xmx", "Xmx" + xmx + "m"); - sb.setConfig("javastart_Xms", "Xms" + xmx + "m"); - prop.put("setStartupCommit", "1"); + if (!(serverSystem.isWin32 && xmx >= 2000)){ + sb.setConfig("javastart_Xmx", "Xmx" + xmx + "m"); + sb.setConfig("javastart_Xms", "Xms" + xmx + "m"); + prop.put("setStartupCommit", "1"); + } } } final Map defaultSettings = ((post == null) || (!(post.containsKey("submitdefault")))) ? null : serverFileUtils.loadHashMap(defaultSettingsFile); diff --git a/source/de/anomic/server/serverSystem.java b/source/de/anomic/server/serverSystem.java index ba08e88dd..64456ded5 100644 --- a/source/de/anomic/server/serverSystem.java +++ b/source/de/anomic/server/serverSystem.java @@ -51,6 +51,7 @@ public final class serverSystem { public static final boolean isUnixFS; public static final boolean canExecUnix; public static final boolean isWindows; + public static final boolean isWin32; // calculated system constants public static int maxPathLength = 65535; @@ -83,6 +84,7 @@ public final class serverSystem { isUnixFS = ((systemOS == systemMacOSX) || (systemOS == systemUnix)); canExecUnix = ((isUnixFS) || (!((systemOS == systemMacOSC) || (systemOS == systemWindows)))); isWindows = (systemOS == systemWindows); + isWin32 = (isWindows && System.getProperty("os.arch", "").contains("x86")); // set up the MRJ Methods through reflection if (isMacArchitecture) try {