[GC (Allocation Failure) [PSYoungGen: 6651K->480K(9216K)] 6651K->6632K(19456K), 0.0092862 secs] [Times: user=0.04 sys=0.00, real=0.01 secs] [Full GC (Ergonomics) [PSYoungGen: 480K->0K(9216K)] [ParOldGen: 6152K->6434K(10240K)] 6632K->6434K(19456K), [Metaspace: 2642K->2642K(1056768K)], 0.0048153 secs] [Times: user=0.02 sys=0.01, real=0.01 secs] hello world Heap PSYoungGen total 9216K, used 2374K [0x00000007bf600000, 0x00000007c0000000, 0x00000007c0000000) eden space 8192K, 28% used [0x00000007bf600000,0x00000007bf851838,0x00000007bfe00000) from space 1024K, 0% used [0x00000007bfe00000,0x00000007bfe00000,0x00000007bff00000) to space 1024K, 0% used [0x00000007bff00000,0x00000007bff00000,0x00000007c0000000) ParOldGen total 10240K, used 6434K [0x00000007bec00000, 0x00000007bf600000, 0x00000007bf600000) object space 10240K, 62% used [0x00000007bec00000,0x00000007bf248a90,0x00000007bf600000) Metaspace used 2650K, capacity 4486K, committed 4864K, reserved 1056768K class space used 286K, capacity 386K, committed 512K, reserved 1048576K
public static void main(String[] args) { int size = 1024 * 1024 ; byte[] alloc = new byte[size * 4]; }
输出结果:
1 2 3 4 5 6 7 8 9
Heap def new generation total 9216K, used 656K [0x00000007bec00000, 0x00000007bf600000, 0x00000007bf600000) eden space 8192K, 8% used [0x00000007bec00000, 0x00000007beca4028, 0x00000007bf400000) from space 1024K, 0% used [0x00000007bf400000, 0x00000007bf400000, 0x00000007bf500000) to space 1024K, 0% used [0x00000007bf500000, 0x00000007bf500000, 0x00000007bf600000) tenured generation total 10240K, used 5136K [0x00000007bf600000, 0x00000007c0000000, 0x00000007c0000000) the space 10240K, 50% used [0x00000007bf600000, 0x00000007bfb04020, 0x00000007bfb04200, 0x00000007c0000000) Metaspace used 2648K, capacity 4486K, committed 4864K, reserved 1056768K class space used 286K, capacity 386K, committed 512K, reserved 1048576K