jdk/test/java/util/Arrays/Big.java
changeset 45062 37ed4313c8c1
parent 5506 202f599c92aa
equal deleted inserted replaced
45061:74b09ee3cd55 45062:37ed4313c8c1
     1 /*
     1 /*
     2  * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    28  * @author Martin Buchholz
    28  * @author Martin Buchholz
    29  */
    29  */
    30 
    30 
    31 // A proper regression test for 5045582 requires too much memory.
    31 // A proper regression test for 5045582 requires too much memory.
    32 // If you have a really big machine, run like this:
    32 // If you have a really big machine, run like this:
    33 // java -d64 -Xms25g -Xmx25g Big 30
    33 // java -Xms25g -Xmx25g Big 30
    34 
    34 
    35 import java.util.*;
    35 import java.util.*;
    36 
    36 
    37 public class Big {
    37 public class Big {
    38 
    38 
    66             equal(a[n-3], (byte) 43);
    66             equal(a[n-3], (byte) 43);
    67             equal(a[n-4], (byte)  0);
    67             equal(a[n-4], (byte)  0);
    68         }
    68         }
    69 
    69 
    70         // To test Object arrays larger than 1<<30, you need 13GB. Run like:
    70         // To test Object arrays larger than 1<<30, you need 13GB. Run like:
    71         // java -d64 -Xms13g -Xmx13g Big 30 2
    71         // java -Xms13g -Xmx13g Big 30 2
    72         if ((tasks & 0x2) != 0) {
    72         if ((tasks & 0x2) != 0) {
    73             System.out.println("Integer[]");
    73             System.out.println("Integer[]");
    74             System.gc();
    74             System.gc();
    75             Integer[] a = new Integer[n];
    75             Integer[] a = new Integer[n];
    76             Integer ZERO = 0;
    76             Integer ZERO = 0;