!7 static int n = 20000; p { for (int listSize = 0; listSize < 100; listSize += 10) { O[] array = new O[n]; long mem1 = usedMemoryAfterGC(); for i over array: array[i] = rep(null, n); long mem2 = usedMemoryAfterGC(); double objSize = (mem2-mem1)/(double) l(array); int rounded = iround(objSize); long f = guessArrayListSize(listSize); print("ArrayList size=" + listSize + ". Approximate object size: " + objSize + " => " + rounded + " bytes. Formula: " + f); } }