From f7ae609966472be884752fe1da2941cbc274aa2d Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 29 Jul 2009 10:43:15 +0000
Subject: [PATCH] Revert to previous version (committed inadvertently).
---
opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java | 50 ++++++++++++++++++++------------------------------
1 files changed, 20 insertions(+), 30 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java b/opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java
index f2f9199..a0b90c8 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java
@@ -102,10 +102,6 @@
private static final String INITIAL_CLIENT_HEAP_ARG = "-Xms8m";
- private static final String SERVER_HEAP_ARGS = "-Xms256m -Xmx512m";
-
- private static final long SERVER_MAX_HEAP_BYTES = 512 * 1024 * 1024;
-
/**
* Invokes the method ConfigureDS.configMain with the provided parameters.
* @param args the arguments to be passed to ConfigureDS.configMain.
@@ -930,17 +926,10 @@
boolean supportsClient = supportsClient(javaHome, installPath);
boolean supportsServer = supportsServer(javaHome, installPath);
- boolean supportsClientInitialHeap =
- supportsOption(INITIAL_CLIENT_HEAP_ARG, javaHome, installPath);
- boolean supportsServerInitialHeap = false;
- // If the current max memory is bigger than the max heap we want to set,
- // assume that the JVM ergonomics are going to be able to allocate enough
- // memory.
- if (Runtime.getRuntime().maxMemory() < SERVER_MAX_HEAP_BYTES)
- {
- supportsServerInitialHeap =
- supportsOption(SERVER_HEAP_ARGS, javaHome, installPath);
- }
+
+ boolean supportsClientInitialHeap = supportsInitialHeap(javaHome,
+ installPath);
+
// Scripts to which we will pass -client argument
String[] clientScripts =
{
@@ -961,25 +950,12 @@
"upgrade", "verify-index", "dbtest"
};
- if (supportsServer || supportsServerInitialHeap)
+ if (supportsServer)
{
for (int i=0; i<serverScripts.length; i++)
{
writer.newLine();
- String arg = "";
- if (supportsServer)
- {
- arg = "-server";
- }
- if (supportsServerInitialHeap)
- {
- if (arg.length() > 0)
- {
- arg += " ";
- }
- arg += SERVER_HEAP_ARGS;
- }
- writer.write(serverScripts[i]+".java-args="+arg);
+ writer.write(serverScripts[i]+".java-args=-server");
}
}
else
@@ -991,6 +967,7 @@
}
}
+
if (supportsClient || supportsClientInitialHeap)
{
for (int i=0; i<clientScripts.length; i++)
@@ -1108,6 +1085,19 @@
}
/**
+ * Tells whether the provided java installation supports the server option
+ * or not.
+ * @param javaHome the java installation path.
+ * @param installPath the install path of the server.
+ * @return <CODE>true</CODE> if the provided java installation supports the
+ * server option and <CODE>false</CODE> otherwise.
+ */
+ private boolean supportsInitialHeap(String javaHome, String installPath)
+ {
+ return supportsOption(INITIAL_CLIENT_HEAP_ARG, javaHome, installPath);
+ }
+
+ /**
* Tells whether the provided java installation supports the client option
* or not.
* @param javaHome the java installation path.
--
Gitblit v1.10.0