根据书中所说,java虚拟机存放年轻代对象是在eden区域,现在有这么一段代码
public class AllocationMain {
public static void main(String[] args) {
}
}
vm options:
-verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8
输出结果为:
Heap
PSYoungGen total 9216K, used 5527K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
eden space 8192K, 67% used [0x00000000ff600000,0x00000000ffb65cc0,0x00000000ffe00000)
from space 1024K, 0% used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000)
to space 1024K, 0% used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000)
ParOldGen total 10240K, used 0K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)
object space 10240K, 0% used [0x00000000fec00000,0x00000000fec00000,0x00000000ff600000)
Metaspace used 3109K, capacity 4496K, committed 4864K, reserved 1056768K
class space used 332K, capacity 388K, committed 512K, reserved 1048576K
我本身没有创建任何对象,为什么新生代默认还占使用比例(used):60%-70%之间,它里面具体做了什么?
(另:我使用的是idea工具,求教下大神,有没有好用的内存分析工具,感觉Eclipse的Memory Analizer看的不是很明白。)