Long[]
、Integer[]
またはのどちらを使用ArrayList<Integer>
しても、それらすべてが同じメモリ使用量を返すのはなぜですか?
System.out.println("Memory Usage : " + Runtime.getRuntime().totalMemory()/(1024*1024));
System.out.println("Memory Usage : " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/(1024*1024));
//Long[] aa = new Long[70000000];
Integer[] bb = new Integer[70000000];
//ArrayList<Integer> a = new ArrayList<Integer>(70000000);
System.gc();
System.out.println("Memory Usage : " + Runtime.getRuntime().totalMemory()/(1024*1024));
System.out.println("Memory Usage : " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/(1024*1024));