Based on the JVM version (1.4, 5, 6, 7, 8, 9), JVM vendor (Oracle, IBM, HP, Azul, Android), GC algorithm (Serial, Parallel, CMS, G1, Shenandoah) and few other settings, GC log format changes. Thus, today the world has ended up with several GC log formats.
‘GC Log standardization API’ normalizes GC Logs and provides a standardized JSON format as shown below.
Graphs provided by GCeasy is great, but some engineers would like to study every event of the GC log in detail. This standardized JSON format gives them that flexibility. Besides, that engineers can import this data to Excel or Tableau or any other visualization tool.
How to invoke Garbage Collection log standardization API?
Invoking Garbage Collection log analysis is very simple:
3). The body of the HTTP request should contain the Garbage collection log that needs to be analyzed.
4). HTTP Response will be sent back in JSON format. JSON has several important stats about the GC log. Primary element to look in the JSON response is: “isProblem“. This element will have value to be “true” if any memory/performance problems have been discovered. “problem” element will contain the detailed description of the memory problem.
Assuming your GC log file is located in “./my-app-gc.log,” then CURL command to invoke the API is:
It can’t get any more simpler than that? Isn’t it?
Note:use the option “–data-binary” in the CURL instead of using “–data” option. In “–data” new line breaks will be not preserved in the request. New Line breaks should be preserved for legitimate parsing.
You can also invoke the API using any web service client tools such as SOAP UI, Postman Browser Plugin,…..
Fig: POSTing GC logs through PostMan plugin
JSON Response Elements
This is the top-level root element. It will contain an array of GC events. For every GC event reported in the GC Log, you will see an element in this array.
Timestamp at which particular GC event ran
YOUNG – if it’s a young GC event type. FULL – if it’s full GC event type.
Duration for which GC event ran
Amount of bytes reclaimed in this GC event
Overall Heap size before this GC event ran
Overall Heap size after this GC event ran
Young Generation size before this GC event ran
Young Generation size after this GC event ran
Old Generation size before this GC event ran
Old Generation size after this GC event ran
Perm Generation size before this GC event ran
Perm Generation size after this GC event ran
Metaspace size before this GC event ran
Metaspace size after this GC event ran
Willie Smits increased rainfall 25% in three years by planting trees. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop