From da7a2c71c75d72c7e9f21f9d73a7aa439520e4ec Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 14 Aug 2020 00:03:01 -0400 Subject: [PATCH] tamed: TAMED_JAVA_OPTS: New environment variable This will be passed to dslc and then to the JVM. The intent is to permit fine-grained heap ratio tuning. --- RELEASES.md | 9 +++++++++ bin/dslc.in | 2 +- bin/tame | 1 + bin/tamed | 5 +++++ build-aux/Makefile.am | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index f15b8244..e09038eb 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -16,6 +16,15 @@ commits that introduce the changes. To make a new release, run NEXT ==== +This release provides a new environment variable for JVM tuning. It does +not provide any new compiler features or performance enhancements in itself, +though it enables optimizations through JVM tuning. + +Compiler +-------- +- The new environment variable `TAMED_JAVA_OPTS` can now be used to provide + arguments to the JVM. This feature was added to support heap ratio + tuning. Miscellaneous ------------- diff --git a/bin/dslc.in b/bin/dslc.in index 3598bf30..64f62b03 100644 --- a/bin/dslc.in +++ b/bin/dslc.in @@ -37,6 +37,6 @@ rater-path() CLASSPATH="$CLASSPATH:@DSLC_CLASSPATH@:$dslc_jar" \ - "@JAVA@" @JAVA_OPTS@ \ + "@JAVA@" @JAVA_OPTS@ $JAVA_OPTS \ com.lovullo.dslc.DslCompiler \ "$( rater-path )" diff --git a/bin/tame b/bin/tame index 5788c5f8..3ba4ad26 100755 --- a/bin/tame +++ b/bin/tame @@ -36,6 +36,7 @@ declare -ri TAME_CMD_WAITTIME="${TAME_CMD_WAITTIME:-3}" # propagate to daemon export TAMED_STALL_SECONDS export TAMED_SPAWNER_PID +export TAMED_JAVA_OPTS # Send a single command to the next available runner and diff --git a/bin/tamed b/bin/tamed index 8722d660..aff451f4 100755 --- a/bin/tamed +++ b/bin/tamed @@ -32,6 +32,10 @@ declare -ri TAMED_STALL_SECONDS="${TAMED_STALL_SECONDS:-1}" # id of process that indirectly spawned tamed (default $PPID) declare -ri TAMED_SPAWNER_PID="${TAMED_SPAWNER_PID:-$PPID}" +# options to pass to JVM via dslc +declare -r TAMED_JAVA_OPTS="${TAMED_JAVA_OPTS:-}" +export JAVA_OPTS="$TAMED_JAVA_OPTS" + # set by `main', global for `cleanup' declare root= @@ -258,6 +262,7 @@ Environment Variables: runner is automatically killed (default 1) TAMED_SPAWNER_PID inhibit stalling while this process is running (default PPID) + TAMED_JAVA_OPTS opts to pass to dslc, and in turn, the JVM EOF exit $EX_USAGE diff --git a/build-aux/Makefile.am b/build-aux/Makefile.am index bdb5a5f0..102bd922 100644 --- a/build-aux/Makefile.am +++ b/build-aux/Makefile.am @@ -95,6 +95,7 @@ SHELL = /bin/bash -O extglob -O nullglob # propagate to tame{,d} export TAME_CMD_WAITTIME export TAMED_STALL_SECONDS +export TAMED_JAVA_OPTS TAMED_SPAWNER_PID=$(shell echo $$PPID) export TAMED_SPAWNER_PID