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 TestNoEagerReclaimOfHumongousRegions 26 * @bug 8139424 27 * @summary Test to check that a live humongous object is not eagerly reclaimed. This is a regression test for 28 * 8139424 and the test will crash if an eager reclaim occur. The test is not 100% deterministic and 29 * might pass even if there are problems in the code, but it will never crash unless there is a problem. 30 * @requires vm.gc.G1 31 * @key gc 32 * @library /testlibrary /test/lib 33 * @modules java.base/jdk.internal.misc 34 * @build TestNoEagerReclaimOfHumongousRegions 35 * @run main ClassFileInstaller sun.hotspot.WhiteBox 36 * sun.hotspot.WhiteBox$WhiteBoxPermission 37 * @run main/othervm -Xbootclasspath/a:. -Xlog:gc,gc+humongous=debug -XX:+UseG1GC -XX:MaxTenuringThreshold=0 -XX:G1RSetSparseRegionEntries=32 -XX:G1HeapRegionSize=1m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestNoEagerReclaimOfHumongousRegions 38 */ 39 40 import java.util.LinkedList; 41 42 import sun.hotspot.WhiteBox; 43 44 public class TestNoEagerReclaimOfHumongousRegions { 45 // Helper class to keep reference to humongous byte[]. 46 static class LargeRef { 47 private byte[] _ref; 48 49 LargeRef(byte[] ref) { 50 _ref = ref; 51 } 52 53 byte[] ref() { return _ref; } 54 } | 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 TestNoEagerReclaimOfHumongousRegions 26 * @bug 8139424 27 * @summary Test to check that a live humongous object is not eagerly reclaimed. This is a regression test for 28 * 8139424 and the test will crash if an eager reclaim occur. The test is not 100% deterministic and 29 * might pass even if there are problems in the code, but it will never crash unless there is a problem. 30 * @requires vm.gc.G1 31 * @key gc 32 * @library /test/lib 33 * @modules java.base/jdk.internal.misc 34 * @build sun.hotspot.WhiteBox 35 * @run main ClassFileInstaller sun.hotspot.WhiteBox 36 * sun.hotspot.WhiteBox$WhiteBoxPermission 37 * @run main/othervm -Xbootclasspath/a:. -Xlog:gc,gc+humongous=debug -XX:+UseG1GC -XX:MaxTenuringThreshold=0 -XX:G1RSetSparseRegionEntries=32 -XX:G1HeapRegionSize=1m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestNoEagerReclaimOfHumongousRegions 38 */ 39 40 import java.util.LinkedList; 41 42 import sun.hotspot.WhiteBox; 43 44 public class TestNoEagerReclaimOfHumongousRegions { 45 // Helper class to keep reference to humongous byte[]. 46 static class LargeRef { 47 private byte[] _ref; 48 49 LargeRef(byte[] ref) { 50 _ref = ref; 51 } 52 53 byte[] ref() { return _ref; } 54 } |