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.

Thermostat can be run with different configurations, the two basic being local and shell. Just running thermostat local  auto detects JVMs running on your local machine and you get some nice host level metrics right away:

IMG_20160628_102622

 

It will also break down the memory sections for fine-tuned garbage collection monitoring and debugging:

IMG_20160628_103017

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).


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 


DevNation is now part of Red Hat Summit.  See www.redhat.com/Summit.  Red Hat Summit is for developers!

Leave a Reply