test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java
--- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java Tue Aug 28 16:01:01 2018 -0700
+++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java Tue Aug 28 16:01:12 2018 -0700
@@ -34,6 +34,7 @@
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.dcmd.CommandExecutor;
import jdk.test.lib.dcmd.JMXExecutor;
+import jdk.test.lib.Platform;
import sun.tools.attach.HotSpotVirtualMachine;
import static optionsvalidation.JVMOptionsUtils.failedMessage;
@@ -384,6 +385,17 @@
runJava.add(VMType);
}
+ // Run with a small heap to avoid excessive execution time
+ long max = Runtime.getRuntime().maxMemory() / 1024 / 1024;
+ if (max > 1024) {
+ runJava.add("-Xmx1024m");
+ }
+
+ if (Platform.isDebugBuild()) {
+ // Avoid excessive execution time.
+ runJava.add("-XX:-ZapUnusedHeapArea");
+ }
+
if (GCType != null &&
!(prepend.contains("-XX:+UseConcMarkSweepGC") ||
prepend.contains("-XX:+UseSerialGC") ||