Garbage collection log analysis complements APM tools
There are already a bunch of tools on the market to help manage your apps. So, why do you need a garbage collection specific one? In this article, Ram Lakshmanan explains how garbage collection log analysis is important for the health and efficiency of your apps.
Recently, a rather smart engineering manager from a major financial institution asked, “We are already using the APM tools from AppDynamics, why do we also need to use a garbage collection log analysis tool like GCeasy?” That’s a fair question and it requires a detailed answer. There are two main answers to this question: purpose and metrics.
Let’s review them in this article.
APM tools are fantastic tools used to monitor your application’s performance and health in a production environment. They give a big picture overview on your application’s availability as well as its performance in production environment. However, they aren’t meant to optimize & tune your application’s garbage collection and memory settings.
APM tools are typically meant to be used in a production environment. On the other hand, GC log analysis tools can be used in a development, testing, and production environments.
Garbage collection log analysis tools provide a rich set of micrometrics for both garbage collection and other memory related metrics. These metrics often aren’t provided by APM tools. Here is a overview of such metrics that are provided only by GCeasy.
Garbage Collection KPIs
There are three key performance indicators when it comes to garbage collection analysis:
- Latency (i.e. GC Pause time)
APM tools reports only the footprint and not the other two critical KPI. For more details on Garbage Collection KPIs, check out this article.
Within one single GC event, there are multiple phases. For example, the G1 GC algorithm has following phases: initial mark, root region scanning, concurrent marking, remark, and cleanup. The CMS GC algorithm has following phases: initial mark, concurrent mark, concurrent preclean, concurrent abortable preclean, final remark, concurrent sweep, and concurrent reset.
APM tools doesn’t give metrics on these individual phases, whereas GCeasy provides detailed metrics on each phase. These metrics are crucial when you are tuning or optimizing the GC and memory settings of your application.
Garbage collection doesn’t add value in processing customer transactions by itself. It is a necessary task to clean-up unreferenced objects and make room to handle new incoming requests. However, garbage collection consumes a considerable amount of CPU and causes application to pause. As a result, you should try to reduce number of times your GC events run and the amount of time it takes to run.
GCeasy reports the reasons that are triggering garbage collection events. If these reasons can be addressed, developers can minimize their GC event counts and pause times, making their apps more efficient. GC Causes aren’t reported by APM tools.
ML algorithms to detect problems
GCeasy employs machine learning algorithms to detect various memory or GC related problems. Detected problems are reported in report. GCeasy not only detects problems, but it also recommends solutions to fix the detected problems. Take a look below for some of the problems and solutions that the GCeasy tool has reported.
ML algorithms: Memory tuning recommendations
GCeasy’s machine learning algorithms provide tips for optimizing and tuning GC and memory related settings in the JVM.
REST API for CI/CD Integration
GCeasy provides JSON based REST API to analyze garbage collection logs. Instead of manually uploading GC logs and analyzing, you can use this API to analyze hundreds/thousands of GC logs automatically. The API provides detailed micrometrics on various aspects of application’s memory and GC utilization. These APIs are used by enterprises in their CI/CD pipeline. It also facilitates to catch various GC and memory related performance problems right during code commit time.
Amount of memory wasted
Today, many enterprises waste anywhere between 30% to 80% of memory because of inefficient programming practices. These practices can include things like duplication of string, inefficient data structure implementation, suboptimal data type definitions, overallocation and underutilization of generation sizes, and more.
GCeasy’s sister product HeapHero is the first tool in the industry to report the amount of memory wasted due to inefficient programming.
Garbage collection log analysis tools such as GCeasy, Garbage Cat, and HP Jmeter aren’t meant to replacement to APM tools such as AppDynamics, NewRelic, Dynatrace, or Wily Introscope. Instead, garbage collection log analysis tool complements APM tools by providing additional metrics and purposes.