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:
1). Register with us. We will email you the API key. This is a one-time setup process. Note: If you have purchased enterprise version, you don’t have to register. API key will be provided to you as a part of installation instruction.
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.