diff --git a/jdk/test/jdk/internal/platform/docker/MetricsMemoryTester.java b/jdk/test/jdk/internal/platform/docker/MetricsMemoryTester.java index 62216b51994..40568c0ce54 100644 --- a/jdk/test/jdk/internal/platform/docker/MetricsMemoryTester.java +++ b/jdk/test/jdk/internal/platform/docker/MetricsMemoryTester.java @@ -75,12 +75,12 @@ private static void testMemoryFailCount() { } else { long count = Metrics.systemMetrics().getMemoryFailCount(); - // Allocate 512M of data - byte[][] bytes = new byte[64][]; + // Allocate 512M of data in 1M chunks per iteration + byte[][] bytes = new byte[64 * 8][]; boolean atLeastOneAllocationWorked = false; - for (int i = 0; i < 64; i++) { + for (int i = 0; i < 64 * 8; i++) { try { - bytes[i] = new byte[8 * 1024 * 1024]; + bytes[i] = new byte[1024 * 1024]; atLeastOneAllocationWorked = true; // Break out as soon as we see an increase in failcount // to avoid getting killed by the OOM killer.