Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8257774: G1: Trigger collect when free region count drops below threshold to prevent evacuation failures #3143

Closed
wants to merge 15 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
Expand Up @@ -250,6 +250,8 @@ private void testWithEvacuationFailureLogs() throws Exception {
"-XX:+G1EvacuationFailureALot",
"-XX:G1EvacuationFailureALotCount=100",
"-XX:G1EvacuationFailureALotInterval=1",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:-G1AllowPreventiveGC",
"-Xlog:gc+phases=debug",
GCTestWithEvacuationFailure.class.getName());

Expand All @@ -261,6 +263,8 @@ private void testWithEvacuationFailureLogs() throws Exception {
"-Xmx32M",
"-Xmn16M",
"-Xms32M",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:-G1AllowPreventiveGC",
"-Xlog:gc+phases=trace",
GCTestWithEvacuationFailure.class.getName());

Expand Down Expand Up @@ -314,17 +318,16 @@ public static void main(String [] args) {
static class GCTestWithEvacuationFailure {
private static byte[] garbage;
private static byte[] largeObject;
private static Object[] holder = new Object[800]; // Must be larger than G1EvacuationFailureALotCount
private static Object[] holder = new Object[200]; // Must be larger than G1EvacuationFailureALotCount

public static void main(String [] args) {
largeObject = new byte[16*1024*1024];
System.out.println("Creating garbage");
// Create 64 MB of garbage. This should result in at least one GC,
// Create 16 MB of garbage. This should result in at least one GC,
// (Heap size is 32M, we use 17MB for the large object above)
// which is larger than G1EvacuationFailureALotInterval and enough
// will survive to cause the evacuation failure.
// which is larger than G1EvacuationFailureALotInterval.
for (int i = 0; i < 16 * 1024; i++) {
holder[i % holder.length] = new byte[4096];
holder[i % holder.length] = new byte[1024];
}
System.out.println("Done");
}
Expand Down