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 TestEagerReclaimHumongousRegionsClearMarkBits 26 * @bug 8051973 27 * @summary Test to make sure that eager reclaim of humongous objects correctly clears 28 * mark bitmaps at reclaim. 29 * @key gc 30 * @library /testlibrary 31 * @modules java.base/sun.misc 32 * java.management 33 */ 34 35 import java.util.ArrayList; 36 import java.util.LinkedList; 37 import java.util.Random; 38 39 import com.oracle.java.testlibrary.OutputAnalyzer; 40 import com.oracle.java.testlibrary.ProcessTools; 41 42 // An object that has a few references to other instances to slow down marking. 43 class ObjectWithSomeRefs { 44 public ObjectWithSomeRefs other1; 45 public ObjectWithSomeRefs other2; 46 public ObjectWithSomeRefs other3; 47 public ObjectWithSomeRefs other4; 48 } 49 50 class ReclaimRegionFast { 51 public static final long MAX_MILLIS_FOR_RUN = 50 * 1000; // The maximum runtime for the actual test. 52 53 public static final int M = 1024*1024; 54 55 public static LinkedList<Object> garbageList = new LinkedList<Object>(); 56 57 public static void genGarbage(Object large) { 58 for (int i = 0; i < 64*1024; i++) { 59 Object[] garbage = new Object[50]; 60 garbage[0] = large; | 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 TestEagerReclaimHumongousRegionsClearMarkBits 26 * @bug 8051973 27 * @summary Test to make sure that eager reclaim of humongous objects correctly clears 28 * mark bitmaps at reclaim. 29 * @key gc 30 * @library /testlibrary 31 * @modules java.base/sun.misc 32 * java.management 33 */ 34 35 import java.util.ArrayList; 36 import java.util.LinkedList; 37 import java.util.Random; 38 39 import jdk.test.lib.OutputAnalyzer; 40 import jdk.test.lib.ProcessTools; 41 42 // An object that has a few references to other instances to slow down marking. 43 class ObjectWithSomeRefs { 44 public ObjectWithSomeRefs other1; 45 public ObjectWithSomeRefs other2; 46 public ObjectWithSomeRefs other3; 47 public ObjectWithSomeRefs other4; 48 } 49 50 class ReclaimRegionFast { 51 public static final long MAX_MILLIS_FOR_RUN = 50 * 1000; // The maximum runtime for the actual test. 52 53 public static final int M = 1024*1024; 54 55 public static LinkedList<Object> garbageList = new LinkedList<Object>(); 56 57 public static void genGarbage(Object large) { 58 for (int i = 0; i < 64*1024; i++) { 59 Object[] garbage = new Object[50]; 60 garbage[0] = large; |