Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Invoking Garbage Collection log standardization API?

Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).";" target="_new" rel="nofollow">Register with us. We will email you the API key. This is a one-time setup process. Note: If you have purchased";" target="_new" rel="nofollow">enterprise version, you don’t have to register. API key will be provided to you as a part of installation instruction.

2). Post HTTP request to{API_KEY_SENT_IN_EMAIL}

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.

CURL command

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.

Other Tools

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

Sample Response

JSON Response Elements

gcEventsThis 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.
timeStampTimestamp at which particular GC event ran
gcTypeYOUNG – if it’s a young GC event type. FULL – if it’s full GC event type.
durationInSecsDuration for which GC event ran
reclaimedBytesAmount of bytes reclaimed in this GC event
heapSizeBeforeGCOverall Heap size before this GC event ran
heapSizeAfterGCOverall Heap size after this GC event ran
youngGenSizeBeforeGCYoung Generation size before this GC event ran
youngGenSizeAfterGCYoung Generation size after this GC event ran
oldGenSizeBeforeGCOld Generation size before this GC event ran
oldGenSizeAfterGCOld Generation size after this GC event ran
permGenSizeBeforeGCPerm Generation size before this GC event ran
permGenSizeAfterGCPerm Generation size after this GC event ran
metaSpaceSizeBeforeGCMetaspace size before this GC event ran
metaSpaceSizeAfterGCMetaspace 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
    Bookmark Topic Watch Topic
  • New Topic