< prev index next >

test/gc/arguments/TestArrayAllocatorMallocLimit.java

Print this page




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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 /*
  25  * @test TestArrayAllocatorMallocLimit
  26  * @summary Sanity check that the ArrayAllocatorMallocLimit flag can be set.
  27  * The test helps verifying that size_t flags can be set/read.
  28  * @bug 8054823
  29  * @key gc
  30  * @library /testlibrary
  31  * @modules java.base/jdk.internal.misc
  32  *          java.management
  33  * @run driver TestArrayAllocatorMallocLimit
  34  */
  35 
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.OutputAnalyzer;
  38 import jdk.test.lib.ProcessTools;
  39 import java.math.BigInteger;
  40 
  41 public class TestArrayAllocatorMallocLimit {
  42   public static void main(String [] args) throws Exception {
  43     testDefaultValue();
  44     testSetValue();
  45   }
  46 
  47   private static final String flagName = "ArrayAllocatorMallocLimit";
  48 
  49   //     size_t ArrayAllocatorMallocLimit                 = 18446744073709551615{experimental}
  50   private static final String printFlagsFinalPattern = " *size_t *" + flagName + " *:?= *(\\d+) *\\{experimental\\} *";
  51 
  52   public static void testDefaultValue()  throws Exception {
  53     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  54       "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version");
  55 
  56     OutputAnalyzer output = new OutputAnalyzer(pb.start());
  57     String value = output.firstMatch(printFlagsFinalPattern, 1);
  58 




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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 /*
  25  * @test TestArrayAllocatorMallocLimit
  26  * @summary Sanity check that the ArrayAllocatorMallocLimit flag can be set.
  27  * The test helps verifying that size_t flags can be set/read.
  28  * @bug 8054823
  29  * @key gc
  30  * @library /test/lib
  31  * @modules java.base/jdk.internal.misc
  32  *          java.management
  33  * @run driver TestArrayAllocatorMallocLimit
  34  */
  35 
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.process.OutputAnalyzer;
  38 import jdk.test.lib.process.ProcessTools;
  39 import java.math.BigInteger;
  40 
  41 public class TestArrayAllocatorMallocLimit {
  42   public static void main(String [] args) throws Exception {
  43     testDefaultValue();
  44     testSetValue();
  45   }
  46 
  47   private static final String flagName = "ArrayAllocatorMallocLimit";
  48 
  49   //     size_t ArrayAllocatorMallocLimit                 = 18446744073709551615{experimental}
  50   private static final String printFlagsFinalPattern = " *size_t *" + flagName + " *:?= *(\\d+) *\\{experimental\\} *";
  51 
  52   public static void testDefaultValue()  throws Exception {
  53     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  54       "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version");
  55 
  56     OutputAnalyzer output = new OutputAnalyzer(pb.start());
  57     String value = output.firstMatch(printFlagsFinalPattern, 1);
  58 


< prev index next >