-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
373 lines (305 loc) · 13.7 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
GCViewer 1.34.1
===============
GCViewer is a little tool that visualizes verbose GC output
generated by Sun / Oracle, IBM, HP and BEA Java Virtual Machines. It
is free software released under GNU LGPL.
You can start GCViewer (gui) by simply double-clicking on gcviewer-1.3x.jar
or running java -jar gcviewer-1.3x.jar (it needs a java 1.8 vm to run).
For a cmdline based report summary just type:
java -jar gcviewer-1.3x.jar gc.log summary.csv [chart.png] [-t PLAIN|CSV|CSV_TS|SIMPLE|SUMMARY]
to generate a report (including optional chart image file).
Supported verbose:gc formats are:
- Oracle JDK 1.8 -Xloggc:<file> [-XX:+PrintGCDetails] [-XX:+PrintGCDateStamps]
- Sun / Oracle JDK 1.7 with option -Xloggc:<file> [-XX:+PrintGCDetails] [-XX:+PrintGCDateStamps]
- Sun / Oracle JDK 1.6 with option -Xloggc:<file> [-XX:+PrintGCDetails] [-XX:+PrintGCDateStamps]
- Sun JDK 1.4/1.5 with the option -Xloggc:<file> [-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]
Best results are achieved with: -Xloggc:<file> -XX:+PrintGCDetails -XX:+PrintGCDateStamps.
A few other options are supported, but most of the information generated is ignored by GCViewer
(the javadoc introduction of
https://github.com/chewiebug/GCViewer/blob/master/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderSun1_6_0.java
shows the details).
Hendrik Schreiber wrote GCViewer up to 1.29. What you are seeing here is based
on his very good work.
Links to detailed descriptions of many JVM parameters relevant to garbage collection
can be found in the links section of https://github.com/chewiebug/GCViewer/wiki
GCViewer shows a number of lines etc. in a chart (first tab). These are:
- Full GC Lines:
o Black vertical line at every Full GC
- Inc GC Lines:
o Cyan vertical line at every Incremental GC
- GC Times Line:
o Green line that shows the length of all GCs
- GC Times Rectangles:
o black rectangle at every Full GC
o blue rectangle at every inital mark event
o orange rectangle at every remark event
o red rectangle at every vm operation event ("application stopped...")
o Grey rectangle at every 'normal' GC
o Light grey rectangle at every Incremental GC
- Total Heap:
o Red line that shows heap size
- Tenured Generation:
o Magenta area that shows the size of the tenured
generation (not available without PrintGCDetails)
- Young Generation:
o Orange area that shows the size of the young
generation (not available without PrintGCDetails)
- Used Heap:
o Blue line that shows used heap size
- Initial mark level:
o 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
o 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: <number of events parsed>, <min duration>, <max duration>...
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 <number of events parsed> ...
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.
Metrics
=======
GCViewer provides some metrics to help you interpret the graph.
Note that some metrics based on averages are shown along with
their standard deviation. If it is obvious that the standard
deviation is fairly big in comparison to the average, the values
are grayed out, indicating that actual values are much smaller
or bigger than the average.
Summary
-------
- Footprint:
o Maximal amount of memory allocated
- Max heap after conc GC:
o Max used heap after concurrent gc.
- Max tenured after conc GC:
o Max used tenured heap after concurrent gc (followed by % of max tenured / % of max total heap).
- Max heap after full GC:
o Max used heap after full gc. Indicates max live object size and can help to determine heap size.
- Freed Memory:
o Total amount of memory that has been freed
- Freed Mem/Min:
o Amount of memory that has been freed per minute
- Total Time:
o Time data was collected for (only if timestamp was present in log)
- Acc Pauses:
o Sum of all pauses due to GC
- Throughput:
o Time percentage the application was NOT busy with GC
- Full GC Performance:
o 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:
o Performance of minor collections. These are collections
that are not full according to the definition above.
Memory
------
- Total heap (usage / alloc max):
o Max memory usage / allocation in total heap (the last is the
same as "footprint" in Summary)
- Tenured heap (usage / alloc max):
o Max memory usage / allocation in tenured space
- Young heap (usage / alloc max):
o Max memory usage / allocation in young space
- Perm heap (usage / alloc max):
o Max memory usage / allocation in perm space
- Max tenured after conc GC:
o see in "summary" section
- Avg tenured after conc GC:
o average size of tenured heap after concurrent collection
- Max heap after conc GC:
o see in "summary" section
- Avg heap after conc GC:
o average size of concurrent heap after concurrent collection
- Max heap after full GC:
o see in "summary" section
- Avg after full GC:
o The average heap memory consumption after a full collection
- Avg after GC:
o The average heap memory consumption after a minor collection
- Freed Memory:
o Total amount of memory that has been freed
- Freed by full GC:
o Amount of memory that has been freed by full collections
- Freed by GC:
o Amount of memory that has been freed by minor collections
- Avg freed full GC:
o Average amount of memory that has been freed by full
collections
- Avg freed GC:
o Average amount of memory that has been freed by minor
collections
- Avg rel inc after FGC:
o 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:
o 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:
o 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:
o 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)
o 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=<value>.
- avg promotion
o 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
o 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:
o Sum of all pauses due to any kind of GC
- Number of Pauses:
o Count of all pauses due to any kind of GC
- Avg Pause:
o Average length of a GC pause of any kind
- Min / max Pause:
o Shortest /longest pause of any kind
- Avg pause interval:
o avg interval between two pauses of any kind
- Min / max pause interval:
o Min / max interval between two pauses of any kind
- Acc full GC:
o Sum of all pauses due to full collections
- Number of full GC pauses:
o Count of all pauses due to full collections
- Acc GC:
o Sum of all full GC pauses
- Avg full GC:
o Average length of a full GC pause
- Min / max full GC pause:
o Shortest / longest full GC pause
- Acc GC:
o Sum of all pauses due to minor collections
- Number of GC pauses:
o Count of all pauses due to minor collections
- Avg GC:
o Average length of a minor collection pause
- Min / max GC pause:
o Shortest / longest minor GC pause
Notes
=====
This is not a perfect tool. However, GCViewer can help you
getting a grip on finding out what's going on in your application
with regards to garbage collection.
Here are some known limitations.
IBM JDKs
--------
If you have problems with the IBM format, please check that
every line of information is really in one line and not wrapped.
The IBM format actually provides a lot more information than is
visualized.
Sun JDK 1.3.1/1.4 with -verbose:gc
----------------------------------
Sun JDK 1.3.1/1.4 with -verbose:gc does not provide a timestamp.
Therefore values like 'Total Time', 'Throughput', and 'Freed Mem/Min'
cannot be calculated.
Sun / Oracle JDK 1.6 / 1.7 / 1.8 (a.k.a. Java 6 / 7 / 8)
---------------------------
CMS and G1 collector sometimes mix concurrent events with stop the world
collections in the output. In some cases the parser can recover from
such mixed lines, sometimes it can't and will show an error message.
BEA JRockit 1.4.2/1.5/1.6
-------------------------
Concurrently collected garbage may not be reflected correctly in the
data panel.
Export formats
--------------
-> CSV: Comma Separated Values
The CSV format is quite useful for importing the data to a
spreadsheet application. However, it does not export all
data.
-> CSV_TS: Comma Separated Values
CSV format using unix timestamp and one line per gc event.
-> PLAIN: Plain Data
Plain text representation of the gc log. If written from Sun / Oracle gc log
it is usually compatible with HPjmeter.
-> SIMPLE: Simple GC Log
Very simple representation of a gc log in the format
<name of event> <secondes since start of log> <pause time>.
This format is compatible with gchisto (http://java.net/projects/gchisto)
-> SUMMARY:
Detailed summary exporting all details about a gc log file (same as shown in data panel).
Internationalization
--------------------
Provided are a German, an English and a Swedish localStrings.properties
file. If someone feels the need to translate these to another
language, please do so. I will be more than glad, to include it
in a future version of this tool.
Start of log / absolute times
-----------------------------
If you happen to know when the application and GC log was started, you
can specify this time by right-clicking on the time ruler and entering
a start time.
Sun / Oracle VMs: If -XX:+PrintGCDateStamps was used, the proposed start time is
read from the gc log file.
Bug reports
-----------
If you are a developer, you may fork (http://help.github.com/fork-a-repo/)
the repository on http://github.com/chewiebug/GCViewer and send me a
pull request (http://help.github.com/send-pull-requests/). If you plan a bigger
change I'd appreciate a notice in advance.
To file a bug report, please open an issue on
http://github.com/chewiebug/GCViewer/issues or send an email to
[email protected] with a description of the error, the
name of the JVM that produced the GC data and all used flags along
with a sample GC log file.
Building GCViewer from Source
-----------------------------
Download and install Maven3 from http://maven.apache.org/
Download the src distribution of GCViewer.
Execute from the GCViewer base directory (same as pom.xml):
mvn clean install
The executable jar will be placed in the target directory.
Enjoy!
Joerg Wuethrich
http://github.com/chewiebug/GCViewer