changeset 55623:492af1f4b6d5

8220707: [TESTBUG] serviceability/sa/TestHeapDumpForLargeArray.java fails with jtreg -vmoption:-Xmx < 8g Reviewed-by: clanger, sballal, jcbeyler
author ngasson
date Fri, 29 Mar 2019 09:31:44 +0000
parents f062188117ad
children 4f9772f4403d
files test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);