DevNation Live Blog: Analyzing Java applications using Thermostat
Omair Majid, a Red Hat Senior Software Engineer, addressed the primordial issue of performance on the Java Virtual Machine. Performance issues of OS, CPU, Memory, and IO origins plague modern systems and present a complex issue to developers so the Thermostat tool focuses on alleviating and easing serviceability while enhancing monitoring of the JVM.
After highlighting the problem many sources of performance information (CPU Usage, Memory Regions, GC, Classloading, JMX, JIT, IO calls, threading, etc…) and many ways to collect that information (heap dumps, invoking GC, deadlock detection, injecting custom code) Omair introduced the Thermostat project. Thermostat is a serviceability and monitoring tool for OpenJDK that integrates horizontally (across hosts/containers/nodes) and vertically (JVM/app server/middleware libraries/custom app code).
Thermostat can be run via the CLI or via a provided GUI and these two interfaces have feature parity so you will not have to choose one or the other because of missing features. Thermostat even has a rich plugin architecture to allow you to add your own features to the platform. Plugins provide a way to extend thermostat for monitoring domain specific metrics so instead of general information like object allocations, you can collect more relevant information like how many emails are being sent, or how long your transactions are taking. By using the custom plugin architecture in Thermostat you can extend its capabilities to fix your needs.
Everything you need to grow your career.
With your free Red Hat Developer program membership, unlock our library of cheat sheets and ebooks on next-generation application development.SIGN UP
Thermostat can be run with different configurations, the two basic being
shell. Just running
thermostat local auto detects JVMs running on your local machine and you get some nice host level metrics right away:
It will also break down the memory sections for fine-tuned garbage collection monitoring and debugging:
Omair then went on to live debug garbage collections issues, memory leaks, multi-threading blocks, slow response time and more all using Thermostat. After seeing how Thermostat can be used to easily monitor low-level operations and performance of your JVM I know I will be using it the next time the JVM give me trouble. Check out some of the latest features such as a Heap Tree Map, more profiling, GC details, tab completion, as well as future extensions such as Byteman integration and easing the development of custom plugins. Contributions welcome 🙂
Thermostat is available via Red Hat Software Collections (RHSCL).