diff -r f0312c7d5b37 -r ba6c248cae19 test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java --- a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java Wed Nov 13 11:21:15 2019 +0100 +++ b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java Wed Nov 13 11:37:29 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -84,9 +84,6 @@ traceTest(classMain + ", -XX:+UseSerialGC", nmFlag, lpFlag, "-XX:+UseSerialGC"); traceTest(classMain + ", -XX:+UseParallelGC", nmFlag, lpFlag, "-XX:+UseParallelGC"); traceTest(classMain + ", -XX:+UseG1GC", nmFlag, lpFlag, "-XX:+UseG1GC", g1Flag); - if (!Compiler.isGraalEnabled()) { // Graal does not support CMS - traceTest(classMain + ", -XX:+UseConcMarkSweepGC", nmFlag, lpFlag, "-XX:+UseConcMarkSweepGC"); - } } /* @@ -169,15 +166,10 @@ } static class TestListener implements NotificationListener { - private boolean isRelaxed = false; private int triggers = 0; private final long[] count = new long[NUM_TRIGGERS * 2]; private final long[] usedMemory = new long[NUM_TRIGGERS * 2]; - public TestListener() { - isRelaxed = ManagementFactory.getRuntimeMXBean().getInputArguments().contains("-XX:+UseConcMarkSweepGC"); - } - @Override public void handleNotification(Notification notif, Object handback) { MemoryNotificationInfo minfo = MemoryNotificationInfo. @@ -212,11 +204,7 @@ } private boolean checkValue(long value, int target) { - if (!isRelaxed) { - return value == target; - } else { - return value >= target; - } + return value == target; } }