Java Mission Control

Java Mission Control (JMC) is a tool that is used for monitoring and profiling Java-based applications. We can use JMC for Kotlin applications as well. JMC consists of Java Flight Recorder (JFR) and the JMX console. JFR is a profiling tool that collects JVM runtime information, whereas the JMX console is a monitoring tool that presents the JVM data about CPU usage, memory, and garbage collection activities.

Let's explore how to use JMC to perform a recording of the CPU and other resource usage. Then, we will analyze the recorded information for resource utilization.

Consider the program that was used to illustrate the memory leak. This creates an empty HashMap with the default initial capacity(16) and then goes on adding ...

Get Kotlin for Enterprise Applications using Java EE now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.