Skip to content

Commit be9f984

Browse files
committedJan 29, 2022
8280553: resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java can fail if GC occurs
Reviewed-by: alanb, amenkov
1 parent 268880b commit be9f984

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎test/hotspot/jtreg/resourcehogs/serviceability/sa/LingeredAppWithLargeArray.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,12 @@
2323

2424
import jdk.test.lib.apps.LingeredApp;
2525

26+
import java.lang.ref.Reference;
27+
2628
public class LingeredAppWithLargeArray extends LingeredApp {
2729
public static void main(String args[]) {
2830
int[] hugeArray = new int[Integer.MAX_VALUE/2];
2931
LingeredApp.main(args);
32+
Reference.reachabilityFence(hugeArray);
3033
}
3134
}

0 commit comments

Comments
 (0)
Please sign in to comment.