The Java Sessions: Monitoring the JVM

Categories: Java, JVM, Monitoring, GC, Garbage Collection, Instrumentation

One of the other essential tasks regarding the JVM is monitoring. How much stack and heap is your JVM using? What CPU saturation are you using? How many threads are being used, and what kind of threads are being used? What is your garbage collector looking like? How can I tap into the JVM and monitor other aspects of the JVM? All these questions are essential to ask since often administrators of your Java application will need to know these values to deploy and monitor your application.

We will look at the following utilities in detail. VisualVM, Java Flight Recorder, and Java Management Extensions. We will also look at some of the important values when instrumenting your JVM and how to gauge usage so that you can provide your containers with the correct resource information when deploying onto a platform, say, Kubernetes.

  • VisualVM

  • Java Flight Recorder

  • Java Management Extensions

  • Measuring resources over time

  • Measuring garbage collection

  • What flags are important when starting a JVM

  • Viewing a Thread dump

  • Debugging Virtual Threads, where do we stand?

  • Sampling

  • What are some other profiling tools available?