参考《深入理解Java虚拟机》
目录
Java 1.8
- 运行时数据区
- 垃圾收集算法
- 垃圾收集器
一、运行时数据区

2019年11月4日大约 7 分钟
参考《深入理解Java虚拟机》
Java 1.8

2019-11-04T16:05:43.267+0800: 147.981: [GC (Allocation Failure) [PSYoungGen: 150496K->5938K(147456K)] 198958K->57548K(202752K), 0.0304547 secs] [Times: user=0.05 sys=0.00, real=0.03 secs]
Heap after GC invocations=39 (full 3):
PSYoungGen total 147456K, used 5938K [0x00000000f6700000, 0x0000000100000000, 0x0000000100000000)
eden space 141312K, 0% used [0x00000000f6700000,0x00000000f6700000,0x00000000ff100000)
from space 6144K, 96% used [0x00000000ffa00000,0x00000000fffcc8f8,0x0000000100000000)
to space 7680K, 0% used [0x00000000ff100000,0x00000000ff100000,0x00000000ff880000)
ParOldGen total 55296K, used 51610K [0x00000000e3400000, 0x00000000e6a00000, 0x00000000f6700000)
object space 55296K, 93% used [0x00000000e3400000,0x00000000e6666870,0x00000000e6a00000)
Metaspace used 80445K, capacity 83414K, committed 83584K, reserved 1122304K
class space used 10018K, capacity 10577K, committed 10624K, reserved 1048576K
}
{Heap before GC invocations=40 (full 4):
PSYoungGen total 147456K, used 5938K [0x00000000f6700000, 0x0000000100000000, 0x0000000100000000)
eden space 141312K, 0% used [0x00000000f6700000,0x00000000f6700000,0x00000000ff100000)
from space 6144K, 96% used [0x00000000ffa00000,0x00000000fffcc8f8,0x0000000100000000)
to space 7680K, 0% used [0x00000000ff100000,0x00000000ff100000,0x00000000ff880000)
ParOldGen total 55296K, used 51610K [0x00000000e3400000, 0x00000000e6a00000, 0x00000000f6700000)
object space 55296K, 93% used [0x00000000e3400000,0x00000000e6666870,0x00000000e6a00000)
Metaspace used 80445K, capacity 83414K, committed 83584K, reserved 1122304K
class space used 10018K, capacity 10577K, committed 10624K, reserved 1048576K
=====================分割线==========================
2019-11-04T16:05:43.298+0800: 148.011: [Full GC (Ergonomics) [PSYoungGen: 5938K->0K(147456K)] [ParOldGen: 51610K->48605K(83968K)] 57548K->48605K(231424K), [Metaspace: 80445K->80445K(1122304K)], 0.3256949 secs] [Times: user=0.55 sys=0.00, real=0.32 secs]
=====================。。。==========================
jps -ljstat -gc 20295 250 10jstata -options 会输出所有选项 -gc、-class、-gcutil等等jinfo -flags 20295jinfo -flag NewSize 20295jmap -dump:live,format=b,file=/home/hello-group/mgr-map.bin 23456jhat xxx.hprof 然后就可在浏览器访问了 http://localhost:7000jstack -l 20295jstack 136874 > /home/hello-group/mgr-23456-thread.txtfree -h (h也即human,人性化展示)MB、GB之类的free -m 以MB的方式展示,适合内存变化粒度较小时使用free -g 以GB方式展示,目测不常用df -h 人性化展示