We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b48e564 commit c0b4579Copy full SHA for c0b4579
core-java-11/src/main/java/com/baeldung/epsilongc/MemoryPolluter.java
@@ -0,0 +1,18 @@
1
+package com.baeldung.epsilongc;
2
+
3
+public class MemoryPolluter {
4
5
+ private static final int MEGABYTE_IN_BYTES = 1024 * 1024;
6
+ private static final int ITERATION_COUNT = 1024 * 10;
7
8
+ public static void main(String[] args) {
9
+ System.out.println("Starting pollution");
10
11
+ for (int i = 0; i < ITERATION_COUNT; i++) {
12
+ byte[] array = new byte[MEGABYTE_IN_BYTES];
13
+ }
14
15
+ System.out.println("Terminating");
16
17
18
+}
0 commit comments