11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package gc; 25 26 /* 27 * @test TestAgeOutput 28 * @bug 8164936 29 * @summary Check that collectors using age table based aging print an age table even for the first garbage collection 30 * @key gc 31 * @requires vm.gc=="null" 32 * @modules java.base/jdk.internal.misc 33 * @library /test/lib 34 * @build sun.hotspot.WhiteBox 35 * @run driver ClassFileInstaller sun.hotspot.WhiteBox 36 * @run main/othervm -XX:+UseSerialGC gc.TestAgeOutput UseSerialGC 37 * @run main/othervm -XX:+UseG1GC gc.TestAgeOutput UseG1GC 38 */ 39 40 /* 41 * @test TestAgeOutputCMS 42 * @bug 8164936 43 * @key gc 44 * @comment Graal does not support CMS 45 * @requires vm.gc=="null" & !vm.graal.enabled 46 * @modules java.base/jdk.internal.misc 47 * @library /test/lib 48 * @build sun.hotspot.WhiteBox 49 * @run driver ClassFileInstaller sun.hotspot.WhiteBox 50 * @run main/othervm -XX:+UseConcMarkSweepGC gc.TestAgeOutput UseConcMarkSweepGC 51 */ 52 53 import sun.hotspot.WhiteBox; 54 55 import java.util.regex.Matcher; 56 import java.util.regex.Pattern; 57 58 import jdk.test.lib.process.OutputAnalyzer; 59 import jdk.test.lib.process.ProcessTools; 60 61 public class TestAgeOutput { 62 63 public static void checkPattern(String pattern, String what) throws Exception { 64 Pattern r = Pattern.compile(pattern); 65 Matcher m = r.matcher(what); | 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package gc; 25 26 /* 27 * @test TestAgeOutput 28 * @bug 8164936 29 * @summary Check that collectors using age table based aging print an age table even for the first garbage collection 30 * @key gc 31 * @requires vm.gc.Serial & vm.gc.G1 32 * @modules java.base/jdk.internal.misc 33 * @library /test/lib 34 * @build sun.hotspot.WhiteBox 35 * @run driver ClassFileInstaller sun.hotspot.WhiteBox 36 * @run main/othervm -XX:+UseSerialGC gc.TestAgeOutput UseSerialGC 37 * @run main/othervm -XX:+UseG1GC gc.TestAgeOutput UseG1GC 38 */ 39 40 /* 41 * @test TestAgeOutputCMS 42 * @bug 8164936 43 * @key gc 44 * @comment Graal does not support CMS 45 * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled 46 * @modules java.base/jdk.internal.misc 47 * @library /test/lib 48 * @build sun.hotspot.WhiteBox 49 * @run driver ClassFileInstaller sun.hotspot.WhiteBox 50 * @run main/othervm -XX:+UseConcMarkSweepGC gc.TestAgeOutput UseConcMarkSweepGC 51 */ 52 53 import sun.hotspot.WhiteBox; 54 55 import java.util.regex.Matcher; 56 import java.util.regex.Pattern; 57 58 import jdk.test.lib.process.OutputAnalyzer; 59 import jdk.test.lib.process.ProcessTools; 60 61 public class TestAgeOutput { 62 63 public static void checkPattern(String pattern, String what) throws Exception { 64 Pattern r = Pattern.compile(pattern); 65 Matcher m = r.matcher(what); |