Azul Intelligence Cloud The Powerful Analytics Solution That Boosts DevOps Efficiency with Insights from Production Java Runtime Data from Any JVM  

Garbage Collection Log Analyzer

Garbage collection (GC) in Java is notoriously difficult to analyse and understand to determine if different settings are required for an application. This tutorial looks at the GC Log Analyzer from Azul that can display GC data in a simple graphical format.

Video Transcript

Hey, it’s Carl Dea here, a developer advocate at Today I’m going to show you how to generate and analyze garbage collection results with the Azul Platform Prime JDK. After generating the results, we’re going to use a tool called GC Log Analyzer to visualize and explore the results. So head on over to tool locate the tool called GC Log Analyzer and click on the download button. So just as a recap, we used to run a pet clinic application that was a Spring Boot application on Azul Platform Prime. What we did before was use Java-jar, but we’re going to add additional command line switch options, which will generate the logs that we need. So what we’ll do is we’re going to go back the server and we’re going to stop it. Stop the application, just clear that, and we’re going to add additional switch options. As you see here, it’s going to be dash capital X, log, colon, GC, comma, safe point. colon GC log, that’s the file output, and colon, it’s supposed to be decorators that goes into this log file. It’s the default, so it’s empty. And then file count equals zero. There are additional options on the command line for logging garbage collection results. So to see more on those options, they have to be in this order, comma safe point which is the items that you want to log and then GC log is the output file and then to see that go to docs dot Azul and search for unified garbage collection logging and you should find that. And here is the format So output is the output file. We just call it GC.log as you saw before. GC.log and then you see file count. There that is basically so that the log files don’t roll over and you’re just wanting it to be one file because usually there’s other options to have it roll over. But we’re just saying file count equals zero. and that will just keep it as one file. So that GC log analyzer will just load that one file and then you can actually visualize and look at the results. We want to go back to this command line. So these are the command line options that we want to add. And then just like before, we use dash jar space and then the jar file and we want to launch it. So by doing so, We go ahead and launch the application in the same manner. And then once it’s up and running, we will start clicking on things just to create some garbage collection results. So now that’s running, you just want to click around. We want to find owners. Go ahead and you have the pagination. We could just go through. some items, hit the back button, just generate a few results as if it was actually live in production. So back to the server side, we just want to hit control, well we don’t have to hit control C but I will. So just listing, there you see the GC logs. So this is the raw data that is actually outputted. So while it’s running, it’s actually generating logs in the GC.log file on the remote server. But in this case, on my local machine, I want to copy it using sccopy. So here I’m basically using my PEM file because it’s on an Amazon instance. And that’s the IP address. And here is the actual location on the directory on that remote server. And then the dot represents my local. So I just wanna copy it to my local directory. So here I’ve copied the GC log file. and there you see it’s co-located with the GC log analyzer tool. So I just want to just run the swing-based application and then I can optionally just pass that in as an argument, the GC.log file. So from here, I just hit enter and here we’re going to look at… the main window here in the application. So the first thing that loads up, you’ll see in the main split pane window, is the GC log summary. And this not only displays high level information about your Java runtime or your VM. but it’ll also show your Linux operating system and the number of cores. So in this case, there’s four cores and it’s running on the Java 17 zing, the former name of Platform Prime. We could scroll down and you could look at the JIT compiler information here with Platform Prime. we have a JIT compiler that is called Falcon and there’s one thread dedicated to it. So you can configure it later, looking at the documentation to assign more threads to the Falcon JIT compiler. So over on the left, you have your window that shows… graphs on various information related to the GC log. And so if you ever wanna go back to the summary, you just click on this information icon to view the GC log summary. So to go back, for example, we can look at various plots and charts representing, the activity of the GC during the times when we were playing with the Pet Clinic application. So here you can use these handles to zoom in on data points within just this window. So you can hover over the individual points and then you can double click on it. and you could actually see the actual log information. So you can also hover over them and they can tell you the detailed information on that. So there’s GC count. So within this timeframe, it was able to collect very quickly within that. small amount of time. So to see more docs on a GC log analyzer, go ahead and go to prime and then you can search for GC log analyzer in the search window and you should find it under the monitoring and management tab. So there you have it, a quick tutorial on how to use GC the Azul Platform Prime JDK. 

Connect with the Azul Sales Team

Contact our Sales Team