bael-2383: memory polluting code for testing epsilon gc (#6403)

This commit is contained in:
fanatixan 2019-02-24 18:09:22 +01:00 committed by maibin
parent b48e564814
commit c0b4579093
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package com.baeldung.epsilongc;
public class MemoryPolluter {
private static final int MEGABYTE_IN_BYTES = 1024 * 1024;
private static final int ITERATION_COUNT = 1024 * 10;
public static void main(String[] args) {
System.out.println("Starting pollution");
for (int i = 0; i < ITERATION_COUNT; i++) {
byte[] array = new byte[MEGABYTE_IN_BYTES];
}
System.out.println("Terminating");
}
}