mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +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();
|
long maxHeapSize = getMax();
|
||||||
int gcTries = (shrinkHeapInSteps ? GC_TRIES : 1);
|
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
|
// commit 0.5 of total heap size to have enough space
|
||||||
// to both shink and expand
|
// to both shink and expand
|
||||||
while (getCommitted() < maxHeapSize / 2) {
|
while (getCommitted() < maxHeapSize / 2) {
|
||||||
|
@ -215,7 +220,6 @@ public class TestMaxMinHeapFreeRatioFlags {
|
||||||
if (previouslyCommitted <= getCommitted()) {
|
if (previouslyCommitted <= getCommitted()) {
|
||||||
throw new RuntimeException("Heap was not shrinked.");
|
throw new RuntimeException("Heap was not shrinked.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forceGC(int gcTries) {
|
public static void forceGC(int gcTries) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue