< prev index next >

test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java

Print this page




  22  */
  23 
  24 /*
  25  * @test TestEagerReclaimHumongousRegionsWithRefs
  26  * @bug 8048179
  27  * @summary Test to make sure that eager reclaim of humongous objects that have previously
  28  * been referenced by other old gen regions work. We simply try to fill
  29  * up the heap with humongous objects and create a remembered set entry from an object by
  30  * referencing that we know is in the old gen. After changing this reference, the object
  31  * should still be eagerly reclaimable to avoid Full GC.
  32  * @key gc
  33  * @library /testlibrary
  34  * @modules java.base/sun.misc
  35  *          java.management
  36  */
  37 
  38 import java.util.regex.Pattern;
  39 import java.util.regex.Matcher;
  40 import java.util.LinkedList;
  41 
  42 import com.oracle.java.testlibrary.OutputAnalyzer;
  43 import com.oracle.java.testlibrary.ProcessTools;
  44 import static com.oracle.java.testlibrary.Asserts.*;
  45 
  46 class RefHolder {
  47   Object ref;
  48 }
  49 
  50 class ReclaimRegionFast {
  51 
  52     public static final int M = 1024*1024;
  53 
  54     public static LinkedList<Object> garbageList = new LinkedList<Object>();
  55 
  56     public static void genGarbage() {
  57         for (int i = 0; i < 32*1024; i++) {
  58             garbageList.add(new int[100]);
  59         }
  60         garbageList.clear();
  61     }
  62 
  63 
  64     // A large object referenced by a static.




  22  */
  23 
  24 /*
  25  * @test TestEagerReclaimHumongousRegionsWithRefs
  26  * @bug 8048179
  27  * @summary Test to make sure that eager reclaim of humongous objects that have previously
  28  * been referenced by other old gen regions work. We simply try to fill
  29  * up the heap with humongous objects and create a remembered set entry from an object by
  30  * referencing that we know is in the old gen. After changing this reference, the object
  31  * should still be eagerly reclaimable to avoid Full GC.
  32  * @key gc
  33  * @library /testlibrary
  34  * @modules java.base/sun.misc
  35  *          java.management
  36  */
  37 
  38 import java.util.regex.Pattern;
  39 import java.util.regex.Matcher;
  40 import java.util.LinkedList;
  41 
  42 import jdk.test.lib.OutputAnalyzer;
  43 import jdk.test.lib.ProcessTools;
  44 import static jdk.test.lib.Asserts.*;
  45 
  46 class RefHolder {
  47   Object ref;
  48 }
  49 
  50 class ReclaimRegionFast {
  51 
  52     public static final int M = 1024*1024;
  53 
  54     public static LinkedList<Object> garbageList = new LinkedList<Object>();
  55 
  56     public static void genGarbage() {
  57         for (int i = 0; i < 32*1024; i++) {
  58             garbageList.add(new int[100]);
  59         }
  60         garbageList.clear();
  61     }
  62 
  63 
  64     // A large object referenced by a static.


< prev index next >