hotspot/test/gc/g1/humongousObjects/objectGraphTest/GC.java
author kzhaldyb
Wed, 29 Jun 2016 18:40:28 +0300
changeset 39618 ced8c3f59678
parent 39280 86907793a181
child 41705 332239c052cc
permissions -rw-r--r--
8132711: Add tests which check that Humongous objects behave as expected after Mixed GC Reviewed-by: tschatzl, dfazunen
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38256
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
     1
/*
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
     4
 *
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
     7
 * published by the Free Software Foundation.
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
     8
 *
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    13
 * accompanied this code).
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    14
 *
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    18
 *
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    21
 * questions.
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    22
 *
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    23
 */
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    24
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    25
package gc.g1.humongousObjects.objectGraphTest;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    26
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    27
import gc.testlibrary.Helpers;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    28
import jdk.test.lib.Asserts;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    29
import sun.hotspot.WhiteBox;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    30
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    31
import java.util.Arrays;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    32
import java.util.List;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    33
import java.util.function.Consumer;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    34
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    35
/**
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    36
 * Provides methods to initiate GC of requested type and
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    37
 * checks for states of humongous and non-humongous soft/weak externally
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    38
 * referenced objects after GCs
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    39
 */
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    40
public enum GC {
39280
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    41
    CMC {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    42
        @Override
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    43
        public Runnable get() {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    44
            return () -> {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    45
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    46
                WHITE_BOX.g1StartConcMarkCycle();
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    47
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    48
            };
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    49
        }
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    50
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    51
        public Consumer<ReferenceInfo<Object[]>> getChecker() {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    52
            return getCheckerImpl(false, false, true, false);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    53
        }
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    54
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    55
        @Override
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    56
        public List<String> shouldContain() {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    57
            return Arrays.asList(GCTokens.WB_INITIATED_CMC);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    58
        }
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    59
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    60
        @Override
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    61
        public List<String> shouldNotContain() {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    62
            return Arrays.asList(GCTokens.WB_INITIATED_YOUNG_GC, GCTokens.WB_INITIATED_MIXED_GC,
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    63
                    GCTokens.FULL_GC, GCTokens.YOUNG_GC);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    64
        }
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    65
    },
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    66
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    67
    CMC_NO_SURV_ROOTS {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    68
        @Override
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    69
        public Runnable get() {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    70
            return () -> {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    71
                WHITE_BOX.youngGC();
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    72
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    73
                WHITE_BOX.youngGC();
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    74
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    75
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    76
                WHITE_BOX.g1StartConcMarkCycle();
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    77
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    78
            };
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    79
        }
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    80
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    81
        public Consumer<ReferenceInfo<Object[]>> getChecker() {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    82
            return getCheckerImpl(true, false, true, false);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    83
        }
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    84
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    85
        @Override
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    86
        public List<String> shouldContain() {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    87
            return Arrays.asList(GCTokens.WB_INITIATED_CMC);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    88
        }
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    89
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    90
        @Override
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    91
        public List<String> shouldNotContain() {
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    92
            return Arrays.asList(GCTokens.WB_INITIATED_MIXED_GC,
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    93
                    GCTokens.FULL_GC, GCTokens.YOUNG_GC);
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    94
        }
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
    95
    },
38256
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    96
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    97
    YOUNG_GC {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    98
        @Override
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
    99
        public Runnable get() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   100
            return WHITE_BOX::youngGC;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   101
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   102
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   103
        public Consumer<ReferenceInfo<Object[]>> getChecker() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   104
            return getCheckerImpl(false, false, true, false);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   105
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   106
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   107
        @Override
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   108
        public List<String> shouldContain() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   109
            return Arrays.asList(GCTokens.WB_INITIATED_YOUNG_GC);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   110
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   111
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   112
        @Override
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   113
        public List<String> shouldNotContain() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   114
            return Arrays.asList(GCTokens.WB_INITIATED_MIXED_GC, GCTokens.FULL_GC, GCTokens.WB_INITIATED_CMC,
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   115
                    GCTokens.CMC, GCTokens.YOUNG_GC);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   116
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   117
    },
39280
86907793a181 8132713: Add tests which check that Humongous objects behave as expected after finishing ConcMark Cycle
kzhaldyb
parents: 38256
diff changeset
   118
38256
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   119
    FULL_GC {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   120
        @Override
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   121
        public Runnable get() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   122
            return System::gc;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   123
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   124
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   125
        public Consumer<ReferenceInfo<Object[]>> getChecker() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   126
            return getCheckerImpl(true, false, true, false);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   127
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   128
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   129
        @Override
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   130
        public List<String> shouldContain() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   131
            return Arrays.asList(GCTokens.FULL_GC);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   132
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   133
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   134
        @Override
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   135
        public List<String> shouldNotContain() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   136
            return Arrays.asList(GCTokens.WB_INITIATED_YOUNG_GC, GCTokens.WB_INITIATED_MIXED_GC,
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   137
                    GCTokens.WB_INITIATED_CMC, GCTokens.CMC, GCTokens.YOUNG_GC);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   138
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   139
    },
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   140
39618
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   141
    MIXED_GC {
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   142
        @Override
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   143
        public Runnable get() {
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   144
            return () -> {
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   145
                WHITE_BOX.youngGC();
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   146
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   147
                WHITE_BOX.youngGC();
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   148
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   149
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   150
                WHITE_BOX.g1StartConcMarkCycle();
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   151
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   152
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   153
                WHITE_BOX.youngGC();
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   154
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   155
                // Provoking Mixed GC
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   156
                WHITE_BOX.youngGC();// second evacuation pause will be mixed
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   157
                Helpers.waitTillCMCFinished(WHITE_BOX, 0);
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   158
            };
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   159
        }
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   160
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   161
        public Consumer<ReferenceInfo<Object[]>> getChecker() {
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   162
            return getCheckerImpl(true, false, true, false);
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   163
        }
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   164
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   165
        @Override
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   166
        public List<String> shouldContain() {
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   167
            return Arrays.asList(GCTokens.WB_INITIATED_CMC);
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   168
        }
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   169
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   170
        @Override
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   171
        public List<String> shouldNotContain() {
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   172
            return Arrays.asList(GCTokens.YOUNG_GC);
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   173
        }
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   174
    },
ced8c3f59678 8132711: Add tests which check that Humongous objects behave as expected after Mixed GC
kzhaldyb
parents: 39280
diff changeset
   175
38256
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   176
    FULL_GC_MEMORY_PRESSURE {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   177
        @Override
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   178
        public Runnable get() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   179
            return WHITE_BOX::fullGC;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   180
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   181
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   182
        public Consumer<ReferenceInfo<Object[]>> getChecker() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   183
            return getCheckerImpl(true, true, true, true);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   184
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   185
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   186
        @Override
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   187
        public List<String> shouldContain() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   188
            return Arrays.asList(GCTokens.FULL_GC_MEMORY_PRESSURE);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   189
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   190
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   191
        @Override
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   192
        public List<String> shouldNotContain() {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   193
            return Arrays.asList(GCTokens.WB_INITIATED_YOUNG_GC, GCTokens.WB_INITIATED_MIXED_GC,
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   194
                    GCTokens.WB_INITIATED_CMC, GCTokens.CMC, GCTokens.YOUNG_GC, GCTokens.FULL_GC);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   195
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   196
    };
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   197
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   198
    protected String getErrorMessage(ReferenceInfo<Object[]> ref, boolean expectedNull, String gcType) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   199
        return String.format("Externally effectively %s referenced %shumongous object was%s deleted after %s",
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   200
                (ref.softlyReachable ? "soft" : "weak"), (ref.effectiveHumongous ? "" : "non-"),
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   201
                (expectedNull ? " not" : ""), gcType);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   202
    }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   203
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   204
    protected Consumer<ReferenceInfo<Object[]>> getCaseCheck(boolean expectedNull) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   205
        return expectedNull
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   206
                ? r -> Asserts.assertNull(r.reference.get(), getErrorMessage(r, true, name()))
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   207
                : r -> Asserts.assertNotNull(r.reference.get(), getErrorMessage(r, false, name()));
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   208
    }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   209
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   210
    protected Consumer<ReferenceInfo<Object[]>> getCheckerImpl(boolean weakH, boolean softH,
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   211
                                                               boolean weakS, boolean softS) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   212
        return new Checker(getCaseCheck(weakH), getCaseCheck(softH), getCaseCheck(weakS), getCaseCheck(softS));
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   213
    }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   214
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   215
    protected String getGcLogName(String prefix) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   216
        return prefix + "_" + name() + ".gc.log";
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   217
    }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   218
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   219
    private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   220
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   221
    /**
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   222
     * @return method to initiate GC
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   223
     */
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   224
    public abstract Runnable get();
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   225
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   226
    /**
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   227
     * @return checker for objects' states after GC
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   228
     */
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   229
    public abstract Consumer<ReferenceInfo<Object[]>> getChecker();
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   230
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   231
    /**
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   232
     * @return list of tokens that should be contained in gc log after gc of specified type
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   233
     */
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   234
    public abstract List<String> shouldContain();
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   235
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   236
    /**
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   237
     * @return list of tokens that should not be contained in gc log after gc of specified type
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   238
     */
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   239
    public abstract List<String> shouldNotContain();
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   240
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   241
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   242
    /**
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   243
     * Checks object' state after gc
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   244
     * Contains 4 Consumers which are called depending on humongous/non-humongous and
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   245
     * external weak/soft referenced objects
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   246
     */
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   247
    private static class Checker implements Consumer<ReferenceInfo<Object[]>> {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   248
        // 4 consumers with checks for (humongous /simple objects)*(weak/soft referenced)
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   249
        final Consumer<ReferenceInfo<Object[]>> weakHumongousCheck;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   250
        final Consumer<ReferenceInfo<Object[]>> softHumongousCheck;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   251
        final Consumer<ReferenceInfo<Object[]>> weakSimpleCheck;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   252
        final Consumer<ReferenceInfo<Object[]>> softSimpleCheck;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   253
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   254
        public Checker(Consumer<ReferenceInfo<Object[]>> weakHumongousCheck,
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   255
                       Consumer<ReferenceInfo<Object[]>> softHumongousCheck,
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   256
                       Consumer<ReferenceInfo<Object[]>> weakSimpleCheck,
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   257
                       Consumer<ReferenceInfo<Object[]>> softSimpleCheck) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   258
            this.weakHumongousCheck = weakHumongousCheck;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   259
            this.softHumongousCheck = softHumongousCheck;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   260
            this.weakSimpleCheck = weakSimpleCheck;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   261
            this.softSimpleCheck = softSimpleCheck;
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   262
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   263
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   264
        public void accept(ReferenceInfo<Object[]> ref) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   265
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   266
            System.out.println("reference.get() returned " + ref.reference.get());
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   267
            if (ref.effectiveHumongous && ref.softlyReachable) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   268
                System.out.println("soft and humongous");
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   269
                softHumongousCheck.accept(ref);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   270
            }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   271
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   272
            if (ref.effectiveHumongous && !ref.softlyReachable) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   273
                System.out.println("weak and humongous");
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   274
                weakHumongousCheck.accept(ref);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   275
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   276
            }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   277
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   278
            if (!ref.effectiveHumongous && ref.softlyReachable) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   279
                System.out.println("soft and non-humongous");
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   280
                softSimpleCheck.accept(ref);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   281
            }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   282
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   283
            if (!ref.effectiveHumongous && !ref.softlyReachable) {
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   284
                System.out.println("weak and non-humongous");
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   285
                weakSimpleCheck.accept(ref);
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   286
            }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   287
        }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   288
    }
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   289
685ac27ed264 8132710: Add tests which check that Humongous objects behave as expected after Young GC
kzhaldyb
parents:
diff changeset
   290
}