提交 2196f1e1 编写于 作者: T tschatzl

8054362: gc/g1/TestEagerReclaimHumongousRegions2.java timeout

Summary: Give the test a time limit of approximately one minute so that it exits early on slow machines.
Reviewed-by: ehelin, dfazunen, brutisso
上级 4d0d94ab
...@@ -46,6 +46,8 @@ class ObjectWithSomeRefs { ...@@ -46,6 +46,8 @@ class ObjectWithSomeRefs {
} }
class ReclaimRegionFast { class ReclaimRegionFast {
public static final long MAX_MILLIS_FOR_RUN = 50 * 1000; // The maximum runtime for the actual test.
public static final int M = 1024*1024; public static final int M = 1024*1024;
public static LinkedList<Object> garbageList = new LinkedList<Object>(); public static LinkedList<Object> garbageList = new LinkedList<Object>();
...@@ -83,7 +85,14 @@ class ReclaimRegionFast { ...@@ -83,7 +85,14 @@ class ReclaimRegionFast {
Object ref_from_stack = large1; Object ref_from_stack = large1;
long start_millis = System.currentTimeMillis();
for (int i = 0; i < 20; i++) { for (int i = 0; i < 20; i++) {
long current_millis = System.currentTimeMillis();
if ((current_millis - start_millis) > MAX_MILLIS_FOR_RUN) {
System.out.println("Finishing test because maximum runtime exceeded");
break;
}
// A set of large objects that will be reclaimed eagerly - and hopefully marked. // A set of large objects that will be reclaimed eagerly - and hopefully marked.
large1 = new int[M - 20]; large1 = new int[M - 20];
large2 = new int[M - 20]; large2 = new int[M - 20];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册