mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8153277: [TESTBUG] gc/arguments/TestMaxMinHeapFreeRatioFlags is too sensitive for stray allocations in verifyRatio
Reviewed-by: mgerdin, dfazunen
This commit is contained in:
parent
2f5768493d
commit
b51a55a78c
1 changed files with 5 additions and 1 deletions
|
@ -168,6 +168,11 @@ public class TestMaxMinHeapFreeRatioFlags {
|
|||
long maxHeapSize = getMax();
|
||||
int gcTries = (shrinkHeapInSteps ? GC_TRIES : 1);
|
||||
|
||||
// Initial checks. This also links up everything in these helper methods,
|
||||
// in case it brings more garbage.
|
||||
forceGC(gcTries);
|
||||
verifyRatio(minRatio, maxRatio);
|
||||
|
||||
// commit 0.5 of total heap size to have enough space
|
||||
// to both shink and expand
|
||||
while (getCommitted() < maxHeapSize / 2) {
|
||||
|
@ -215,7 +220,6 @@ public class TestMaxMinHeapFreeRatioFlags {
|
|||
if (previouslyCommitted <= getCommitted()) {
|
||||
throw new RuntimeException("Heap was not shrinked.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void forceGC(int gcTries) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue