Skip to content

Commit c0b4579

Browse files
fanatixanmaibin
authored andcommitted
bael-2383: memory polluting code for testing epsilon gc (eugenp#6403)
1 parent b48e564 commit c0b4579

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)