我有gctrace输出,如下所示:
gc 6 @48.155s 15%: 0.093+12360+0.32 ms clock, 0.18+7720/21356/3615+0.65 ms cpu, 11039->13278->6876 MB, 14183 MB goal, 8 P
我不确定如何特别读取CPU时间。据我所知,它分为三个阶段(STW扫描终止,并发标记/扫描和STW标记终止),但我不确定+符号的含义(即0.18+7720
和3615+0.65
)。这些+符号意味着什么?
答案 0 :(得分:2)
在您的情况下,它们看起来像协助和终止时间;
// CPU time
0.18 : **STW** Sweep termination.
7720ms : Mark/Scan - Assist Time (GC performed in line with allocation).
21356ms : Mark/Scan - Background GC time.
3615ms : Mark/Scan - Idle GC time.
0.65ms : **STW** Mark termination.
我认为它会在各种Go版本中发生变化(或者可能),您可以在runtime package docs找到更详细的信息。
Currently, it is:
gc # @#s #%: #+#+# ms clock, #+#/#/#+# ms cpu, #->#-># MB, # MB goal, # P
where the fields are as follows:
gc # the GC number, incremented at each GC
@#s time in seconds since program start
#% percentage of time spent in GC since program start
#+...+# wall-clock/CPU times for the phases of the GC
#->#-># MB heap size at GC start, at GC end, and live heap
# MB goal goal heap size
# P number of processors used
示例here
另见Interpreting GC trace output
gc 6 @48.155s 15%: 0.093+12360+0.32 ms clock,
0.18+7720/21356/3615+0.65 ms cpu, 11039->13278->6876 MB, 14183 MB goal, 8 P