G1GC GC日志是什么意思?

发布于 2024-10-20 19:34:56 字数 1604 浏览 4 评论 0原文

我不明白 G1GC GC 日志到底意味着什么(添加 PrintGCDetails 和 PrintGCTimeStamps 时)。有人可以阐明语法吗?

[

GC pause (young), 0.03067078 secs]
   [SATB Drain Time:   0.2 ms]
   [Parallel Time:  22.6 ms]
      [GC Worker Start Time (ms):  165213430.0  165213430.0  165213430.0  165213430.0  165213430.0  165213430.0  165213430.1  165213430.1]
      [Update RS (ms):  10.7  10.0  11.1  9.9  9.9  11.2  10.6  8.6
       Avg:  10.3, Min:   8.6, Max:  11.2]
         [Processed Buffers : 14 8 8 12 9 11 10 8
          Sum: 80, Avg: 10, Min: 8, Max: 14]
      [Ext Root Scanning (ms):  2.5  2.6  2.9  3.4  3.3  2.7  2.6  2.4
       Avg:   2.8, Min:   2.4, Max:   3.4]
      [Mark Stack Scanning (ms):  0.0  0.0  0.0  0.0  0.0  0.0  0.0  2.2
       Avg:   0.3, Min:   0.0, Max:   2.2]
      [Scan RS (ms):  4.0  4.1  3.1  3.7  3.9  3.2  3.8  3.9
       Avg:   3.7, Min:   3.1, Max:   4.1]
      [Object Copy (ms):  4.7  5.3  4.7  4.8  4.7  4.7  4.8  4.7
       Avg:   4.8, Min:   4.7, Max:   5.3]
      [Termination (ms):  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
         [Termination Attempts : 23 1 26 23 19 29 22 25
          Sum: 168, Avg: 21, Min: 1, Max: 29]
      [GC Worker End Time (ms):  165213452.3  165213452.3  165213452.3  165213452.3  165213452.3  165213452.3  165213452.3  165213452.3]
      [Other:   0.7 ms]
   [Clear CT:   0.6 ms]
   [Other:   7.3 ms]
      [Choose CSet:   0.0 ms]
   [ 3329M->3245M(6000M)]

完整GC是什么意思?是暂停还是并行?使用哪种GC算法?为什么G1决定使用它?

5.941: [Full GC 7891K->4756K(6000M), 0.1939233 secs]

I do not understand what exactly the G1GC GC logs mean(when adding PrintGCDetails and PrintGCTimeStamps). Can someone shed light on the syntax?

[

GC pause (young), 0.03067078 secs]
   [SATB Drain Time:   0.2 ms]
   [Parallel Time:  22.6 ms]
      [GC Worker Start Time (ms):  165213430.0  165213430.0  165213430.0  165213430.0  165213430.0  165213430.0  165213430.1  165213430.1]
      [Update RS (ms):  10.7  10.0  11.1  9.9  9.9  11.2  10.6  8.6
       Avg:  10.3, Min:   8.6, Max:  11.2]
         [Processed Buffers : 14 8 8 12 9 11 10 8
          Sum: 80, Avg: 10, Min: 8, Max: 14]
      [Ext Root Scanning (ms):  2.5  2.6  2.9  3.4  3.3  2.7  2.6  2.4
       Avg:   2.8, Min:   2.4, Max:   3.4]
      [Mark Stack Scanning (ms):  0.0  0.0  0.0  0.0  0.0  0.0  0.0  2.2
       Avg:   0.3, Min:   0.0, Max:   2.2]
      [Scan RS (ms):  4.0  4.1  3.1  3.7  3.9  3.2  3.8  3.9
       Avg:   3.7, Min:   3.1, Max:   4.1]
      [Object Copy (ms):  4.7  5.3  4.7  4.8  4.7  4.7  4.8  4.7
       Avg:   4.8, Min:   4.7, Max:   5.3]
      [Termination (ms):  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
         [Termination Attempts : 23 1 26 23 19 29 22 25
          Sum: 168, Avg: 21, Min: 1, Max: 29]
      [GC Worker End Time (ms):  165213452.3  165213452.3  165213452.3  165213452.3  165213452.3  165213452.3  165213452.3  165213452.3]
      [Other:   0.7 ms]
   [Clear CT:   0.6 ms]
   [Other:   7.3 ms]
      [Choose CSet:   0.0 ms]
   [ 3329M->3245M(6000M)]

And what does full GC mean ? Is it a pause is it parallelized ? which GC algorithm is used? Why did G1 decided to use it ?

5.941: [Full GC 7891K->4756K(6000M), 0.1939233 secs]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

寻梦旅人 2024-10-27 19:34:56

关于“它是暂停吗?是并行的吗?”的信息很少。
用 Java 的话说,
GC 有两种类型(基于与 mutator 即应用程序的并发性) - (1)Stop-the-world (2)并发

Stop-the-world GC 进一步细分为 - 1a)Stop-the-world 如果数量GC 线程为 1 1b) 如果 GC 线程数超过 1,则并行

Few information on "Is it a pause is it parallelized ?"
In Java parlance,
GC are two types (based on concurrency with mutator i.e. application) - (1)Stop-the-world (2)Concurrent

Stop-the-world GC are further sub-categorized as - 1a)Stop-the-world if the number of GC threads is one 1b)Parallel if the number of GC threads is more than one

你是暖光i 2024-10-27 19:34:56

以下内容来自我在 G1 GC 上在线找到的(相当有限的)材料的字里行间。 (付费墙后面有一篇 2004 年的论文、JavaWorld 2008 的幻灯片以及 G1 GC页面。如果有人有其他链接,请添加。)

完整 GC 是什么意思?

与其他 HotSpot GC 一样,堆分为新空间或伊甸园空间、幸存者空间和旧对象空间或终身对象空间。然而,与其他 HotSpot GC 不同的是,G1 使用多个区域来保存空间。

通常,G1 收集器与应用程序线程并行增量运行,跟踪对象并将其“疏散”到其他区域。然而,收集器有时可能会落后很多,以至于必须停止一切,并使用所有可用的处理器来收集所有堆区域。我认为这是一次完整的GC。

它是并行的吗?

我认为它是并行的,但也是停止世界的。

使用哪种GC算法?

目前还不清楚。

为什么G1决定使用它?

见上文。它落后得太远了,堆里堆满了垃圾。

The following is from reading between the lines of the (rather limited) material I could find online on G1 GC. (There's a paper from 2004 behind a paywall, a slideshow from JavaWorld 2008, and the G1 GC page. If anyone has other links, please add them.)

And what does full GC mean ?

As with other HotSpot GCs, the heap is divided into a New or Eden space, Survivor space(s) and Old or Tenured Object space. However, unlike other HotSpot GCs, G1 uses multiple regions to hold the spaces.

Normally, the G1 collector runs incrementally in parallel with application threads, tracing and "evacuating" objects into other regions. However, it appears that the collector can sometimes get so far behind that it has to stop everything, and use all available processors to collect all of the heap regions. I think that this is a full GC.

Is it a pause is it parallelized ?

I think it is parallelized, but also stop-the-world.

which GC algorithm is used?

It is not clear.

Why did G1 decided to use it ?

See above. It got too far behind and the heap was full of garbage.

海风掠过北极光 2024-10-27 19:34:56

来自 oracle g1gc 博客technetwork 文章

完整 GC 是什么意思?

对于 G1GC,任何超过区域大小一半的对象都被视为“巨大对象”。这样的对象直接在老年代中分配到“巨大区域”中。 这些 Humongous 区域是一组连续的区域。

死亡的 Humongous 对象在清理阶段以及完整垃圾收集周期的标记周期结束时被释放

为了减少复制开销,Humongous 对象不包含在任何疏散暂停中。 完整的垃圾收集周期会压缩 Humongous 对象。

通常,完整 GC 会清理整个堆 - 年轻堆和终身堆空格(旧代)

另一方面,您必须担心“应用程序线程停止”的时间,无论 GC 类型如何:Young GC 或 Full GC 等。

是不是暂停了,是不是并行化了?

YounGC 是并行化的,但不是 FullGC

Full GC: 当前是 G1 full GC是单线程并且非常慢,我们应该尽可能避免完整的GC(来自Oracle 文章)

使用哪种GC算法?

你是指Young GC/Major GC/Full GC吗?从你的日志来看,最后一行是 Full GC,第一行是 YoungGC。

为什么G1决定使用它?

在回答第一个查询时进行了解释。

关于G1GC微调,请查看oracle 文章及相关内容SE问题

From oracle g1gc blog and technetwork article

And what does full GC mean ?

For G1GC, any object that is more than half a region size is considered a "Humongous object". Such an object is allocated directly in the old generation into "Humongous regions". These Humongous regions are a contiguous set of regions.

Dead Humongous objects are freed at the end of the marking cycle during the cleanup phase also during a full garbage collection cycle.

In-order to reduce copying overhead, the Humongous objects are not included in any evacuation pause. A full garbage collection cycle compacts Humongous objects in place.

Generally Full GC is cleans entire Heap – both Young and Tenured spaces (old gen)

On a different note, you have to worry about how much time "application threads were stopped" irrespective of GC type : Young GC or Full GC etc.

Is it a pause is it parallelized?

YounGC is parallelized but not FullGC

Full GCs: Currently G1 full gc is single threaded and very slow, we should try to avoid full gcs as much as possible ( From oracle article)

which GC algorithm is used?

Do you mean Young GC/Major GC/Full GC? From your logs, it's Full GC for last line and YounGC for first line.

Why did G1 decided to use it ?

Explained in response for first query.

Regarding G1GC fine tuning, have look at oracle article and related SE question

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文