Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,17 @@ public static void makeOldAllocations() {
int deriveIndex = r.nextInt(ArraySize);
switch (i & 0x3) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...otherwise could you just do (i & 0x1) here and change cases 2 & 3 to cases 0 & 1?

case 0:
// 50% chance of creating garbage
array[replaceIndex] = array[replaceIndex].max(array[deriveIndex]);
break;
case 1:
// 50% chance of creating garbage
array[replaceIndex] = array[replaceIndex].min(array[deriveIndex]);
break;
case 2:
// creates new old BigInteger, releases old BigInteger,
// may create ephemeral data while computing gcd
array[replaceIndex] = array[replaceIndex].gcd(array[deriveIndex]);
break;
case 3:
case 1:
// creates new old BigInteger, releases old BigInteger
array[replaceIndex] = array[replaceIndex].multiply(array[deriveIndex]);
break;
case 2,3:
// do nothing, let all objects in the array age to increase pressure on old generation
break;
}
}
}
Expand Down Expand Up @@ -106,5 +101,17 @@ public static void main(String[] args) throws Exception {
"-XX:ShenandoahGuaranteedYoungGCInterval=0",
"-XX:ShenandoahGuaranteedOldGCInterval=0"
);

testOld("-Xlog:gc",
"-Xms96m",
"-Xmx96m",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseShenandoahGC",
"-XX:ShenandoahGCMode=generational",
"-XX:ShenandoahGuaranteedYoungGCInterval=0",
"-XX:ShenandoahGuaranteedOldGCInterval=0",
"-XX:+UseCompactObjectHeaders"
);
}
}