We can look at our code and start to profile the parts of the system we suspect have performance issues, or we can use a profiler and obtain information about the entire system as a whole. These tools gather runtime data and monitor resource consumption in terms of CPU, memory, threads, classes, and I/O.
There are several tools available for profiling Java applications, including the following:
- Tools that come with the JVM, such as VisualVM, JStat, JMap, and more
- Specialized tools, such as JProfiler, Java Mision Control, and Yourkit
- Lightweight profilers that come with APMs, like those we saw in Chapter 12, Monitoring, using New Relic