1.下载适用的版本

https://github.com/chewiebug/GCViewer

Supported verbose:gc formats are:

  • Oracle JDK 1.8 -Xloggc: [-XX:+PrintGCDetails] [-XX:+PrintGCDateStamps]
  • Sun / Oracle JDK 1.7 with option -Xloggc: [-XX:+PrintGCDetails] [-XX:+PrintGCDateStamps]
  • Sun / Oracle JDK 1.6 with option -Xloggc: [-XX:+PrintGCDetails] [-XX:+PrintGCDateStamps]
  • Sun JDK 1.4/1.5 with the option -Xloggc: [-XX:+PrintGCDetails]
  • Sun JDK 1.2.2/1.3.1/1.4 with the option -verbose:gc
  • IBM JDK 1.3.1/1.3.0/1.2.2 with the option -verbose:gc
  • IBM iSeries Classic JVM 1.4.2 with option -verbose:gc
  • HP-UX JDK 1.2/1.3/1.4.x with the option -Xverbosegc
  • BEA JRockit 1.4.2/1.5/1.6 with the option -verbose:memory [-Xverbose:gcpause,gcreport] [-Xverbosetimestamp]

我使用的jdk8,点击tab的wiki

点击

下载当前最新版本1.3.5的jar文件

2. 执行在windows环境

从cmd进入jar目录,执行jar -jar xxx.jar

出现图形界面,加载gc.log文件后如下图所示:

我们先了解一下各个颜色代表的含义:

GCViewer shows a number of lines etc. in a chart (first tab). These are:

  • Full GC Lines:

    • Black vertical line at every Full GC
  • Inc GC Lines:
    • Cyan vertical line at every Incremental GC
  • GC Times Line:
    • Green line that shows the length of all GCs
  • GC Times Rectangles:
    • black rectangle at every Full GC
    • blue rectangle at every inital mark event
    • orange rectangle at every remark event
    • red rectangle at every vm operation event ("application stopped...")
    • Grey rectangle at every 'normal' GC
    • Light grey rectangle at every Incremental GC
  • Total Heap:
    • Red line that shows heap size
  • Tenured Generation:
    • Magenta area that shows the size of the tenured generation (not available without PrintGCDetails)
  • Young Generation:
    • Orange area that shows the size of the young generation (not available without PrintGCDetails)
  • Used Heap:
    • Blue line that shows used heap size
  • Initial mark level:
    • Yellow line that shows the heap usage at "initial-mark" event (only available when the gc algorithm uses concurrent collections, which is the case for CMS and G1)
  • Concurrent collections
    • Cyan vertical line for every begin (concurrent-mark-start) and pink vertical line for every end (CMS-concurrent-reset / G1: concurrent-cleanup-end) of a concurrent collection cycle

In the second tab ("Event details") it shows details about the events it parsed: E.g. events like the following

24.187: [GC 24.188: [ParNew: 93184K->5464K(104832K), 0.0442895 secs] \ 93184K->5464K(1036928K), 0.0447149 secs] \ [Times: user=0.39 sys=0.07, real=0.05 secs]

are shown in one line as GC ParNew: , , ...

Events like these

4183.962: [Full GC 4183.962: [CMS: 32957K->40326K(932096K), 2.3313389 secs] \ 76067K->40326K(1036928K), [CMS Perm : 43837K->43453K(43880K)], 2.3339606 secs] \ [Times: user=2.33 sys=0.01, real=2.33 secs]

are shown as Full GC; CMS; CMS Perm ...

So for every line the text is extracted (not always every part of it). This allows a user which is familiar with the text log files to find out more details about the events that occurred.

3. 各个参数的意义:

Summary

  • Footprint:

    • Maximal amount of memory allocated
  • Max heap after conc GC:
    • Max used heap after concurrent gc.
  • Max tenured after conc GC:
    • Max used tenured heap after concurrent gc (followed by % of max tenured / % of max total heap).
  • Max heap after full GC:
    • Max used heap after full gc. Indicates max live object size and can help to determine heap size.
  • Freed Memory:
    • Total amount of memory that has been freed
  • Freed Mem/Min:
    • Amount of memory that has been freed per minute
  • Total Time:
    • Time data was collected for (only if timestamp was present in log)
  • Acc Pauses:
    • Sum of all pauses due to GC
  • Throughput:
    • Time percentage the application was NOT busy with GC
  • Full GC Performance:
    • Performance of full collections. Note that all collections that include a collection of the tenured generation or are marked with "Full GC" are considered Full GC.
  • GC Performance:
    • Performance of minor collections. These are collections that are not full according to the definition above.

Memory

  • Total heap (usage / alloc max):

    • Max memory usage / allocation in total heap (the last is the same as "footprint" in Summary)
  • Tenured heap (usage / alloc max):
    • Max memory usage / allocation in tenured space
  • Young heap (usage / alloc max):
    • Max memory usage / allocation in young space
  • Perm heap (usage / alloc max):
    • Max memory usage / allocation in perm space
  • Max tenured after conc GC:
    • see in "summary" section
  • Avg tenured after conc GC:
    • average size of tenured heap after concurrent collection
  • Max heap after conc GC:
    • see in "summary" section
  • Avg heap after conc GC:
    • average size of concurrent heap after concurrent collection
  • Max heap after full GC:
    • see in "summary" section
  • Avg after full GC:
    • The average heap memory consumption after a full collection
  • Avg after GC:
    • The average heap memory consumption after a minor collection
  • Freed Memory:
    • Total amount of memory that has been freed
  • Freed by full GC:
    • Amount of memory that has been freed by full collections
  • Freed by GC:
    • Amount of memory that has been freed by minor collections
  • Avg freed full GC:
    • Average amount of memory that has been freed by full collections
  • Avg freed GC:
    • Average amount of memory that has been freed by minor collections
  • Avg rel inc after FGC:
    • Average relative increase in memory consumption between full collections. This is the average difference between the memory consumption after a full collection to the memory consumption after the next full collection.
  • Avg rel inc after GC:
    • Average relative increase in memory consumption between minor collections. This is the average difference between the memory consumption after a minor collection to the memory consumption after the next minor collection. This can be used as an indicator for the amount of memory that survives minor collections and has to be moved to the survivor spaces or the tenured generation. This value added to "Avg freed GC" gives you an idea about the size of the young generation in case you don't have PrintGCDetails turned on.
  • Slope full GC:
    • Slope of the regression line for the memory consumption after full collections. This can be used as an indicator for the increase in indispensable memory consumption (base footprint) of an application over time.
  • Slope GC:
    • Average of the slope of the regression lines for the memory consumption after minor collections in between full collections. That is, if you have two full collections and many minor collections in between, GCViewer will calculate the slope for the minor collections up to the first full collection, then the slope of the minor collections between the first and the second full collection. Then it will compute a weighted average (each slope wil be weighted with the number of measuring points it was computed with).
  • initiatingOccFraction (avg / max)
    • CMS GC kicks in before tenured generation is filled. InitiatingOccupancyFraction tells you the avg / max usage in % of the tenured generation, when CMS GC started (initial mark). This value can be set manually using -XX:CMSInitiatingOccupancyFraction=.
  • avg promotion
    • Promotion means the size of objects that are promoted from young to tenured generation during a young generation collection. Avg promotion shows the average amount of memory that is promoted from young to tenured with each young collection (only available with PrintGCDetails)
  • total promotion
    • Total promotion shows the total amount of memory that is promoted from young to tenured with all young collections in a file (only available with PrintGCDetails)

Pause

  • Acc Pauses:

    • Sum of all pauses due to any kind of GC
  • Number of Pauses:
    • Count of all pauses due to any kind of GC
  • Avg Pause:
    • Average length of a GC pause of any kind
  • Min / max Pause:
    • Shortest /longest pause of any kind
  • Avg pause interval:
    • avg interval between two pauses of any kind
  • Min / max pause interval:
    • Min / max interval between two pauses of any kind

  • Acc full GC:

    • Sum of all pauses due to full collections
  • Number of full GC pauses:
    • Count of all pauses due to full collections
  • Acc GC:
    • Sum of all full GC pauses
  • Avg full GC:
    • Average length of a full GC pause
  • Min / max full GC pause:
    • Shortest / longest full GC pause

  • Acc GC:

    • Sum of all pauses due to minor collections
  • Number of GC pauses:
    • Count of all pauses due to minor collections
  • Avg GC:
    • Average length of a minor collection pause
  • Min / max GC pause:
    • Shortest / longest minor GC pause

gcview使用的更多相关文章

  1. JVM问题定位工具

    JDB JDB是基于文本和命令行的调试工具,Jikes在JDB的基础上提供了GUI.熟悉JDB还是有价值的,很多情况下需要我们在命令行下完成简单的debug问题定位. 1 2 3 jdb -class ...

随机推荐

  1. php对csv文件的读取,写入,输出下载操作

    在实际工作中,很多时候需要把网站上的一些数据下载到CSV文件里,方便以后查看. 亦或者是用CSV进行一些批量的上传工作. 这个时候我们就需要对CSV进行读写操作. 1.CSV的读取操作 <?ph ...

  2. Mac OS X 系统12个常用的文本编辑快捷键(移动、选中)

    经常和文字处理打交道?如果多多使用下面这 12 个快捷键,在移动.选择.复制等操作文字时效率会大大提升. 6 个移动光标的快捷键第一组快捷键可以用来在文本中快速移动光标: 跳到本行开头 – Comma ...

  3. 移动APP的IM后台架构浅析

    IM(InstantMessaging 即时通讯)作为一项基础功能,很多APP都有,比如:手机QQ.微信.易信.钉钉.飞信.旺旺.咚咚.陌陌等.而IM如同我们日常生活中的水和电一样,必不可少,也是很多 ...

  4. 在线视频转gif动画工具 在线视频转gif动画工具下载

    在线视频转gif动画工具 在线视频转gif动画工具下载 http://www.leawo.cn/space-1723875-do-thread-id-60715.html http://www.lea ...

  5. Android中的内部类引起的内存泄露

    引子 什么是内部类?什么是内存泄露?为什么Android的内部类容易引起内存泄露?如何解决? 什么是内部类? 什么是内部类?什么又是外部类.匿名类.局部类.顶层类.嵌套类?大家可以参考我这篇文章 ,再 ...

  6. cache 浅析

    http://blog.chinaunix.net/uid-26817832-id-3244916.html   1. Cache Cache一词来源于法语,其原意是"藏匿处,隐秘的地方&q ...

  7. zz 圣诞丨太阁所有的免费算法视频资料整理

    首发于 太阁实验室 关注专栏   写文章     圣诞丨太阁所有的免费算法视频资料整理 Ray Cao· 12 小时前 感谢大家一年以来对太阁实验室的支持,我们特地整理了在过去一年中我们所有的原创算法 ...

  8. showmessage函数里

    首先说一下,漏洞是t00ls核心群传出去的,xhming先去读的,然后我后来读的,读出来的都是代码执行,1月5日夜里11点多钟,在核心群的黑客们的要求下,xhming给了个poc,我给了个exp,确实 ...

  9. Transaction recovery: lock conflict caught and ignored

    Transaction recovery: lock conflict caught and ignored环境:RAC 4节点.oracle 11.2.0.4.redhat 5.9 64bit 问题 ...

  10. 菜鸟教程之工具使用(十一)——Eclipse去掉未使用的引用

    大家在写代码的时候经常会看到如下的情况: 大家都知道这是因为引入了未使用的包,所以Eclipse给出了提示,告诉你这些是无用的引用,这些无用的引用即影响了美观,又增加了代码占用的空间,还给代码的编译增 ...