2727 * @test
2828 * @summary Test PrintVMInfoAtExit
2929 * @library /test/lib
30+ * @build jdk.test.whitebox.WhiteBox
31+ * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
3032 * @modules java.base/jdk.internal.misc
3133 * @requires vm.flagless
3234 * @requires vm.bits == "64"
33- * @run driver PrintVMInfoAtExitTest
35+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI PrintVMInfoAtExitTest
3436 */
3537
3638import jdk .test .lib .process .OutputAnalyzer ;
3739import jdk .test .lib .process .ProcessTools ;
40+ import jdk .test .whitebox .WhiteBox ;
41+
3842
3943public class PrintVMInfoAtExitTest {
4044
@@ -53,7 +57,14 @@ public static void main(String[] args) throws Exception {
5357 output_detail .shouldContain ("-- S U M M A R Y --" );
5458 output_detail .shouldContain ("Command Line: -Xmx64M -Xms64M -XX:-CreateCoredumpOnCrash -XX:+UnlockDiagnosticVMOptions -XX:+PrintVMInfoAtExit -XX:NativeMemoryTracking=summary -XX:CompressedClassSpaceSize=256m" );
5559 output_detail .shouldContain ("Native Memory Tracking:" );
56- output_detail .shouldContain ("Java Heap (reserved=65536KB, committed=65536KB)" );
60+ WhiteBox wb = WhiteBox .getWhiteBox ();
61+ if (wb .isAsanEnabled ()) {
62+ // the reserved value can be influenced by asan
63+ output_detail .shouldContain ("Java Heap (reserved=" );
64+ output_detail .shouldContain (", committed=65536KB)" );
65+ } else {
66+ output_detail .shouldContain ("Java Heap (reserved=65536KB, committed=65536KB)" );
67+ }
5768 }
5869}
5970
0 commit comments