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 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/jdk.internal.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 | 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 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 /test/lib 34 * @modules java.base/jdk.internal.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.process.OutputAnalyzer; 43 import jdk.test.lib.process.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 |