jvm MinorGC和查看GC日志
程序员文章站
2022-05-06 16:57:30
...
【代码】
public class Page93 {
private static final int _1MB = 1024 * 1024;
public static void main(String[] args) {
minorGC();
}
/**
* vm params: -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8
*/
private static void minorGC() {
byte[] allocation1, allocation2, allocation3, allocation4;
allocation1 = new byte[2 * _1MB];
allocation2 = new byte[2 * _1MB];
allocation3 = new byte[2 * _1MB];
allocation4 = new byte[4 * _1MB];
}
}
// 运行结果,打印gc日志
D:\bench-cluster\spring_in_action_eclipse\jvm\src>java -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 chapter3.Page93
Heap
PSYoungGen total 9216K, used 7300K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
eden space 8192K, 89% used [0x00000000ff600000,0x00000000ffd210f0,0x00000000ffe00000)
from space 1024K, 0% used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000)
to space 1024K, 0% used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000)
ParOldGen total 10240K, used 4096K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)
object space 10240K, 40% used [0x00000000fec00000,0x00000000ff000010,0x00000000ff600000)
Metaspace used 2550K, capacity 4486K, committed 4864K, reserved 1056768K
class space used 279K, capacity 386K, committed 512K, reserved 1048576K
有个问题是,Metaspace 是个什么玩意儿啦?
Metaspace 是java8用来替代持久代的产物;参见
https://www.cnblogs.com/xrq730/p/8688203.html
上一篇: 5nm Zen4架构锐龙7000处理器曝光:首次集成GPU
下一篇: php混编的三种方式