[java-wrappers] 26/61: [java-wrappers] Beginnings of a small function for determining the reasonable value for a -Xmx argument

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Tue Oct 24 17:55:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository java-wrappers.

commit d078f7337f5fa278e4f84fe6fb2e09708eb73fa8
Author: Vincent Fourmond <fourmond at debian.org>
Date:   Tue May 4 21:40:12 2010 +0000

    [java-wrappers] Beginnings of a small function for determining the reasonable value for a -Xmx argument
---
 java-wrappers.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/java-wrappers.sh b/java-wrappers.sh
index e08f212..dba8cd2 100644
--- a/java-wrappers.sh
+++ b/java-wrappers.sh
@@ -37,6 +37,16 @@ java_fail() {
     exit 1;
 }
 
+# Try to get the amount of memory available on the machine to come up
+# with a decent -Xmx argument, returned as the value of the
+# determined_xmx_arg (defaults in kilobytes, so you should add k
+# afterwards)
+determine_xmx_arg() {
+    # Yes, that's ugly, so what ??
+    mem=`free -k 2>/dev/null | head -n2 | tail -n1 | sed -r s/'[^0-9]+//' | cut -d' ' -f1`
+
+}
+
 # Try to find a Java runtime and set JAVA_HOME and JAVA_CMD accordingly.
 # If JAVA_CMD exists, nothing is done. If JAVA_HOME exists, only that
 # is searched.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/java-wrappers.git



More information about the pkg-java-commits mailing list