corda/test/GC.java

51 lines
935 B
Java
Raw Normal View History

public class GC {
private static void small() {
2007-06-21 22:51:13 +00:00
for (int i = 0; i < 1024; ++i) {
byte[] a = new byte[4 * 1024];
}
}
2007-06-21 22:51:13 +00:00
private static void medium() {
for (int i = 0; i < 8; ++i) {
2007-06-21 22:51:13 +00:00
Object[] array = new Object[32];
for (int j = 0; j < 32; ++j) {
array[j] = new byte[32 * 1024];
}
2007-06-21 18:35:24 +00:00
}
}
private static void large() {
for (int i = 0; i < 8; ++i) {
byte[] a = new byte[16 * 1024 * 1024];
}
2007-10-28 01:54:30 +00:00
for (int i = 0; i < 8; ++i) {
byte[] a = new byte[16 * 1024 * 1024];
for (int j = 0; j < 32; ++j) {
byte[] b = new byte[32 * 1024];
}
}
}
public static void main(String[] args) {
Object[] array = new Object[1024 * 1024];
array[0] = new Object();
small();
array[1] = new Object();
medium();
array[2] = new Object();
large();
array[0].toString();
array[1].toString();
array[2].toString();
}
}