7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
authorkvn
Sat, 20 Aug 2011 14:03:12 -0700
changeset 10285 21965ee594b9
parent 10279 7adf55aec150
child 10286 74b0f625d56a
7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS Summary: Run test only on systems with 2Gbyte or more memory. Don't zap heap to reduce execution time. Reviewed-by: iveresov
hotspot/test/compiler/5091921/Test7005594.sh
--- a/hotspot/test/compiler/5091921/Test7005594.sh	Fri Aug 19 14:22:25 2011 -0700
+++ b/hotspot/test/compiler/5091921/Test7005594.sh	Sat Aug 20 14:03:12 2011 -0700
@@ -43,6 +43,45 @@
 echo "TESTCLASSES=${TESTCLASSES}"
 echo "CLASSPATH=${CLASSPATH}"
 
+# Amount of physical memory in megabytes
+MEM=0
+if [ -f "/proc/meminfo" ]; then
+  # Linux, Windows/Cygwin
+  MEM=`cat /proc/meminfo |grep ^MemTotal: | awk '{print $2}'`
+  MEM="$(($MEM / 1024))"
+elif [ -x "/usr/sbin/prtconf" ]; then
+  # Solaris
+  MEM=`/usr/sbin/prtconf | grep "^Memory size" | awk '{print $3}'`
+elif [ -x "/usr/sbin/system_profiler" ]; then
+  # MacOS
+  MEMo=`/usr/sbin/system_profiler SPHardwareDataType | grep Memory:`
+  MEM=`echo "$MEMo" | awk '{print $2}'`
+  MEMu=`echo "$MEMo" | awk '{print $3}'`
+  case $MEMu in
+  GB)
+    MEM="$(($MEM * 1024))"
+    ;;
+  MB)
+    ;;
+  *)
+    echo "Unknown memory unit in system_profile output: $MEMu"
+    ;;
+  esac
+elif [ -n "$ROOTDIR" -a -x "$ROOTDIR/mksnt/sysinf" ]; then
+  # Windows/MKS
+  MEM=`"$ROOTDIR/mksnt/sysinf" memory -v | grep "Total Physical Memory: " | sed 's/Total Physical Memory: *//g'`
+  MEM="$(($machine_memory / 1024))"
+else
+  echo "Unable to determine amount of physical memory on the machine"
+fi
+
+if [ $MEM -lt 2000 ]; then
+  echo "Test skipped due to low (or unknown) memory on the system: $MEM Mb"
+  exit 0
+fi
+
+echo "MEMORY=$MEM Mb"
+
 set -x
 
 cp ${TESTSRC}/Test7005594.java .
@@ -50,7 +89,7 @@
 
 ${TESTJAVA}/bin/javac -d . Test7005594.java
 
-${TESTJAVA}/bin/java ${TESTVMOPTS} -Xms1600m -Xcomp -XX:CompileOnly=Test7005594.test Test7005594 > test.out 2>&1
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test Test7005594 > test.out 2>&1
 
 result=$?