8220707: [TESTBUG] serviceability/sa/TestHeapDumpForLargeArray.java fails with jtreg -vmoption:-Xmx < 8g
authorngasson
Fri, 29 Mar 2019 09:31:44 +0000
changeset 54349 492af1f4b6d5
parent 54348 f062188117ad
child 54350 4f9772f4403d
8220707: [TESTBUG] serviceability/sa/TestHeapDumpForLargeArray.java fails with jtreg -vmoption:-Xmx < 8g Reviewed-by: clanger, sballal, jcbeyler
test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java
--- a/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java	Sat Mar 30 21:29:37 2019 +0100
+++ b/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java	Fri Mar 29 09:31:44 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,10 +96,13 @@
         }
 
         try {
+            // Need to add the default arguments first to have explicit
+            // -Xmx8g last, otherwise test will fail if default
+            // arguments contain a smaller -Xmx.
             List<String> vmArgs = new ArrayList<String>();
+            vmArgs.addAll(Utils.getVmOptions());
             vmArgs.add("-XX:+UsePerfData");
             vmArgs.add("-Xmx8g");
-            vmArgs.addAll(Utils.getVmOptions());
 
             theApp = new LingeredAppWithLargeArray();
             LingeredApp.startApp(vmArgs, theApp);