Skip to content

Commit 791b427

Browse files
sendaoYanjerboaa
authored andcommittedJan 23, 2024
8323640: [TESTBUG]testMemoryFailCount in jdk/internal/platform/docker/TestDockerMemoryMetrics.java always fail because OOM killed
Reviewed-by: sgehwolf
1 parent bcaad51 commit 791b427

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ private static void testMemoryFailCount() {
7272
} else {
7373
long count = Metrics.systemMetrics().getMemoryFailCount();
7474

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

0 commit comments

Comments
 (0)
Please sign in to comment.