This is a visual tool integrated as part of the JDK, which has the capability to profile applications. Let's run our banking app from the previous chapters, and review which information we can gather using it.
Now, we are going to use the VisualVM to gather some metrics about the JVM. We can run this tool from the console using the following command:
$ cd JAVA_HOME/bin
$ jvisualvm
We should see a screen similar to the following screenshot:
Using the Locals menu option, you have to attach the Java process that is going to be monitored. In this case, we are going to select banking-app-1.0.jar. Then, we should see a resume of the resources used for the application:
There is also a tab that provides information about Threads, which is shown in the following screenshot:
We can use any tool that we feel comfortable with; a great place to start, and a tool that is easy to use is Jprofiler, but all the tools give us similar information. We need to understand and follow the possible problems generated by any bottleneck that we find in our application.
Debugging performance issues in production can be a difficult task, and, in some cases hard to find and fix. We need a tool that we can feel confident about to understand the bottlenecks, so we need to try different tools and experiment load tests to find the right one for us.