--- old/test/gc/logging/TestPrintReferences.java 2017-06-12 16:20:26.987222163 -0700 +++ new/test/gc/logging/TestPrintReferences.java 2017-06-12 16:20:26.859222167 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, 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 @@ -37,18 +37,35 @@ public class TestPrintReferences { public static void main(String[] args) throws Exception { ProcessBuilder pb_enabled = - ProcessTools.createJavaProcessBuilder("-Xlog:gc+ref=debug", "-Xmx10M", GCTest.class.getName()); + ProcessTools.createJavaProcessBuilder("-Xlog:gc+ref=debug", "-Xmx32M", GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb_enabled.start()); - String countRegex = "[0-9]+ refs"; - String timeRegex = "[0-9]+[.,][0-9]+ms"; - - output.shouldMatch(".* GC\\([0-9]+\\) SoftReference " + timeRegex + "\n" + - ".* GC\\([0-9]+\\) WeakReference " + timeRegex + "\n" + - ".* GC\\([0-9]+\\) FinalReference " + timeRegex + "\n" + - ".* GC\\([0-9]+\\) PhantomReference " + timeRegex + "\n" + - ".* GC\\([0-9]+\\) JNI Weak Reference " + timeRegex + "\n" + - ".* GC\\([0-9]+\\) Ref Counts: Soft: [0-9]+ Weak: [0-9]+ Final: [0-9]+ Phantom: [0-9]+\n"); + String gcLogTimeRegex = ".* GC\\([0-9]+\\)"; + String countRegex = "[0-9]+"; + String timeRegex = "[0-9]+[.,][0-9]+ms\n"; + String refDetailRegex = gcLogTimeRegex + " Phase2: " + timeRegex + + gcLogTimeRegex + " Phase3: " + timeRegex + + gcLogTimeRegex + " Cleared: " + countRegex + "\n" + + gcLogTimeRegex + " Discovered: " + countRegex + "\n"; + String softRefDetailRegex = gcLogTimeRegex + " Phase1: " + timeRegex + + refDetailRegex; + + output.shouldMatch(/* SoftReference processing */ + gcLogTimeRegex + " SoftReference " + timeRegex + softRefDetailRegex + + /* WeakReference processing */ + gcLogTimeRegex + " WeakReference " + timeRegex + refDetailRegex + + /* FinalReference processing */ + gcLogTimeRegex + " FinalReference " + timeRegex + refDetailRegex + + /* PhantomReference processing */ + gcLogTimeRegex + " PhantomReference " + timeRegex + refDetailRegex + + /* JNI Weak Reference processing */ + gcLogTimeRegex + " JNI Weak Reference " + timeRegex + + /* Enqueue Reference Lists */ + gcLogTimeRegex + " Enqueue reference lists " + timeRegex + + /* Enqueued Stats */ + gcLogTimeRegex + " Ref Counts: Soft: " + countRegex + " Weak: " + countRegex + + " Final: " + countRegex + " Phantom: " + countRegex + ); output.shouldHaveExitValue(0); }