From 84f65d81c7139ce7174bb13f8f7dbcd1bee4b4d2 Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Thu, 9 Jul 2026 12:10:54 +0200 Subject: [PATCH 1/3] Upport from 17 --- .../jtreg/runtime/Vitals/TestHiMemReport.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/hotspot/jtreg/runtime/Vitals/TestHiMemReport.java b/test/hotspot/jtreg/runtime/Vitals/TestHiMemReport.java index b21f19af055c..f7434151dad5 100644 --- a/test/hotspot/jtreg/runtime/Vitals/TestHiMemReport.java +++ b/test/hotspot/jtreg/runtime/Vitals/TestHiMemReport.java @@ -98,8 +98,9 @@ public class TestHiMemReport { static void testPrint() throws Exception { ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( - "-XX:+HiMemReport", "-XX:HiMemReportMax=128m", + "-XX:+HiMemReport", "-XX:HiMemReportMax=64m", "-XX:NativeMemoryTracking=summary", + "-Xlog:vitals=trace", "-XX:+PrintVitalsAtExit", "-XX:VitalsSampleInterval=1", "-Xmx128m", "-Xms128m", "-XX:+AlwaysPreTouch", TestHiMemReport.class.getName(), "sleep", "2" // num seconds to sleep to give the reporter thread time to generate output @@ -117,8 +118,9 @@ static void testPrint() throws Exception { static void testDump() throws Exception { ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( - "-XX:+HiMemReport", "-XX:HiMemReportMax=128m", + "-XX:+HiMemReport", "-XX:HiMemReportMax=64m", "-XX:NativeMemoryTracking=summary", + "-Xlog:vitals=trace", "-XX:+PrintVitalsAtExit", "-XX:VitalsSampleInterval=1", "-XX:HiMemReportDir=himemreport-1", "-Xmx128m", "-Xms128m", "-XX:+AlwaysPreTouch", TestHiMemReport.class.getName(), @@ -150,8 +152,9 @@ static void testDumpWithExecToReportDir() throws Exception { String reportDirName = "himemreport-2"; // Here we not only dump, but we also execute several jcmds. Therefore we take some more seconds to sleep ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( - "-XX:+HiMemReport", "-XX:HiMemReportMax=128m", + "-XX:+HiMemReport", "-XX:HiMemReportMax=64m", "-XX:HiMemReportDir=himemreport-2", + "-Xlog:vitals=trace", "-XX:+PrintVitalsAtExit", "-XX:VitalsSampleInterval=1", "-XX:HiMemReportExec=VM.flags -all;VM.metaspace show-loaders;GC.heap_dump", "-XX:NativeMemoryTracking=summary", "-Xmx128m", "-Xms128m", "-XX:+AlwaysPreTouch", @@ -206,7 +209,7 @@ static void testDumpWithExecToReportDir() throws Exception { ".*HiMemReport *= *true.*", ".*HiMemReportDir *= *himemreport-2.*", ".*HiMemReportExec *= *VM.flags.*VM.metaspace.*GC.heap_dump.*", - ".*HiMemReportMax *= *134217728.*" + ".*HiMemReportMax *= *67108864.*" }); // "VM.metaspace": @@ -257,8 +260,9 @@ static void testDumpWithExecToReportDir() throws Exception { // Test multiple Execs, with the output of the commands going to stderr static void testDumpWithExecToStderr() throws Exception { ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( - "-XX:+HiMemReport", "-XX:HiMemReportMax=128m", + "-XX:+HiMemReport", "-XX:HiMemReportMax=64m", "-XX:HiMemReportExec=VM.flags -all;VM.metaspace show-loaders", + "-Xlog:vitals=trace", "-XX:+PrintVitalsAtExit", "-XX:VitalsSampleInterval=1", "-XX:NativeMemoryTracking=summary", "-Xmx128m", "-Xms128m", "-XX:+AlwaysPreTouch", TestHiMemReport.class.getName(), @@ -278,7 +282,7 @@ static void testDumpWithExecToStderr() throws Exception { // ... as well as the output of VM.flags line = VitalsUtils.matchPatterns(lines, line + 1, new String [] { ".*HiMemReport *= *true.*", - ".*HiMemReportMax *= *134217728.*", + ".*HiMemReportMax *= *67108864.*", "HiMemReport: Successfully executed \"VM.flags -all\" \\(\\d+ ms\\)" }); @@ -304,7 +308,8 @@ static void testDumpWithExecToStderr() throws Exception { */ static void testHasNaturalMax() throws IOException { ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( - "-XX:+HiMemReport", "-Xlog:vitals", "-Xmx64m", "-version"); + "-XX:+PrintVitalsAtExit", "-XX:VitalsSampleInterval=1", + "-XX:+HiMemReport", "-Xlog:vitals=trace", "-Xmx64m", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); output.shouldNotMatch("HiMemReport.*limit could not be established"); From a5655167cce43cb06f974db1d7df6cb796a39119 Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Thu, 30 Jul 2026 17:06:35 +0200 Subject: [PATCH 2/3] Don't run test using jmc on static JVM builds. --- .../HeapDump/PartialArrayContentTest.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/HeapDump/PartialArrayContentTest.java b/test/hotspot/jtreg/serviceability/HeapDump/PartialArrayContentTest.java index 48f9024d15aa..788c87bad997 100644 --- a/test/hotspot/jtreg/serviceability/HeapDump/PartialArrayContentTest.java +++ b/test/hotspot/jtreg/serviceability/HeapDump/PartialArrayContentTest.java @@ -41,8 +41,17 @@ * @test * @summary Checks if -XX:+LimitPrimitiveArrayContentInHeapDump works. * @requires os.maxMemory > 4G + * @requires !jdk.static * @library /test/lib - * @run driver PartialArrayContentTest + * @run driver PartialArrayContentTest jmc + */ + +/* + * @test + * @summary Checks if -XX:+LimitPrimitiveArrayContentInHeapDump works. + * @requires os.maxMemory > 4G + * @library /test/lib + * @run driver PartialArrayContentTest oom */ class ArrayAllocApp extends LingeredApp { public static int arraySize = 54321; @@ -91,8 +100,11 @@ public class PartialArrayContentTest { private static int nonCharLikeLimit = 50; public static void main(String[] args) throws Exception { - checkPartialContentWithJcmd(); - checkPartialContentWithOOM(); + if (args[0].equals("jmc")) { + checkPartialContentWithJcmd(); + } else { + checkPartialContentWithOOM(); + } } public static void checkPartialContentWithJcmd() throws Exception { From ea54652e36c020716d332cd3a2ee12ca76eaa954 Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Fri, 31 Jul 2026 11:18:45 +0200 Subject: [PATCH 3/3] It's jcmd not jmc. --- .../serviceability/HeapDump/PartialArrayContentTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/HeapDump/PartialArrayContentTest.java b/test/hotspot/jtreg/serviceability/HeapDump/PartialArrayContentTest.java index 788c87bad997..02ddfdd46580 100644 --- a/test/hotspot/jtreg/serviceability/HeapDump/PartialArrayContentTest.java +++ b/test/hotspot/jtreg/serviceability/HeapDump/PartialArrayContentTest.java @@ -43,7 +43,7 @@ * @requires os.maxMemory > 4G * @requires !jdk.static * @library /test/lib - * @run driver PartialArrayContentTest jmc + * @run driver PartialArrayContentTest jcmd */ /* @@ -100,7 +100,7 @@ public class PartialArrayContentTest { private static int nonCharLikeLimit = 50; public static void main(String[] args) throws Exception { - if (args[0].equals("jmc")) { + if (args[0].equals("jcmd")) { checkPartialContentWithJcmd(); } else { checkPartialContentWithOOM();