GC 日志格式官方解释

原文:
https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/generations.html#sthref16

以下是文中提到JDK1.8 的GC日志格式解释

 ## Measurement

Throughput and footprint are best measured using metrics particular to the application. For example, the throughput of a web server may be tested using a client load generator, whereas the footprint of the server may be measured on the Solaris operating system using the `pmap` command. However, pauses due to garbage collection are easily estimated by inspecting the diagnostic output of the virtual machine itself.

The command-line option `-verbose:gc` causes information about the heap and garbage collection to be printed at each collection. For example, here is output from a large server application:

[GC 325407K->83000K(776768K), 0.2300771 secs]
[GC 325816K->83372K(776768K), 0.2454258 secs]
[Full GC 267628K->83769K(776768K), 1.8479984 secs]


The output shows two minor collections followed by one major collection. The numbers before and after the arrow (for example, `325407K->83000K` from the first line) indicate the combined size of live objects before and after garbage collection, respectively. After minor collections, the size includes some objects that are garbage (no longer alive) but cannot be reclaimed. These objects are either contained in the tenured generation or referenced from the tenured generation.

The next number in parentheses (for example, `(776768K)` again from the first line) is the committed size of the heap: the amount of space usable for Java objects without requesting more memory from the operating system. Note that this number only includes one of the survivor spaces. Except during a garbage collection, only one survivor space will be used at any given time to store objects.

The last item on the line (for example, `0.2300771 secs`) indicates the time taken to perform the collection, which is in this case approximately a quarter of a second.

The format for the major collection in the third line is similar.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 一、AdaptiveSizePolicy简介 AdaptiveSizePolicy(自适应大小策略) 是 JVM ...
    阿菜的博客阅读 20,167评论 4 29
  • 1、JVM的参数类型 1.1 标准参数:在各jdk版本中较稳定 -help-server -client-vers...
    大厂offer阅读 13,059评论 0 8
  • JVM是虚拟机,也是一种规范,他遵循着冯·诺依曼体系结构的设计原理。冯·诺依曼体系结构中,指出计算机处理的数据和指...
    Java小铺阅读 5,039评论 0 16
  • JVM参数分类 JVM参数分为标准参数和非标准参数: 标准参数: "-"开头的参数,如-client, -serv...
    齐晋阅读 8,589评论 0 4
  • 今天第二天,由于下午,今天还是没有开始采摘。早上忐忑走错站点没车拉,幸好没有错过哈哈。 上午跟着小哥哥测...
    Poetrylife阅读 1,644评论 0 0