Skip to content

Commit 28c2c3f

Browse files
SendaoYanPaul Hohensee
authored andcommitted
8323640: [TESTBUG]testMemoryFailCount in jdk/internal/platform/docker/TestDockerMemoryMetrics.java always fail because OOM killed
Reviewed-by: phh Backport-of: 791b427f4410057cdcdf8fd8ea0dcce71f7dc513
1 parent afda078 commit 28c2c3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jdk/test/jdk/internal/platform/docker/MetricsMemoryTester.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ private static void testMemoryFailCount() {
7575
} else {
7676
long count = Metrics.systemMetrics().getMemoryFailCount();
7777

78-
// Allocate 512M of data
79-
byte[][] bytes = new byte[64][];
78+
// Allocate 512M of data in 1M chunks per iteration
79+
byte[][] bytes = new byte[64 * 8][];
8080
boolean atLeastOneAllocationWorked = false;
81-
for (int i = 0; i < 64; i++) {
81+
for (int i = 0; i < 64 * 8; i++) {
8282
try {
83-
bytes[i] = new byte[8 * 1024 * 1024];
83+
bytes[i] = new byte[1024 * 1024];
8484
atLeastOneAllocationWorked = true;
8585
// Break out as soon as we see an increase in failcount
8686
// to avoid getting killed by the OOM killer.

0 commit comments

Comments
 (0)