Permalink
Browse files

Add simple java-run.sh script for Java hello program.

  • Loading branch information...
1 parent 8a4e931 commit c711e8d0cea73d08444550ccfe1c5ce704344cca @jafingerhut jafingerhut committed Apr 5, 2011
Showing with 19 additions and 0 deletions.
  1. +19 −0 hello/java-run.sh
View
@@ -0,0 +1,19 @@
+#! /bin/bash
+
+if [ $# -lt 1 ]
+then
+ 1>&2 echo "usage: `basename $0` <output-file> [ cmd line args for Java program ]"
+ exit 1
+fi
+
+source ../env.sh
+
+OUTP="$1"
+shift
+
+# Use a small limit to avoid using lots of memory. It makes the
+# garbage collector collect more often, but the extra CPU time is not
+# much.
+MAX_HEAP_MB=16
+
+../bin/measureproc ${MP_COMMON_ARGS} ${MP_ARGS_FOR_JVM_RUN} --output "${OUTP}" "${JAVA}" ${JAVA_PROFILING} -server -Xmx${MAX_HEAP_MB}m -classpath ./obj/java hello "$@"

0 comments on commit c711e8d

Please sign in to comment.