SpyGlass Thread Monitor
SpyGlass Thread Monitor is a free VisualVM plugin to monitor java thread activity in real time.
When you're monitoring Web Application or any other J2EE systems you have to work with a huge number of thread at the same times. Currently available VisualVM visualizations are not so effective.
To simplify our monitoring activity we decide to develop this plugin representing most useful thread information.
This plugin collects statistics from Java JMX and presents information in a clear and immediate form to verify if something is going wrong in your system.
In this picture you can see how information is presented.
In the upper left side you can see information related to system performance:
- System Load (or CPU % usage),
- CPU Time (how much CPUC time was used by your system)
- Applicative Threads: number of currently running applicative threads checked on Applicative Package Filter
In the upper right side you can see a lot of thread statistics to understand how much threads you have and their typology:
- Thread summary by state: blocked, runnable, waiting and time waited threads
- Thread statistics: daemon, total thread number, peak thread number
- Running threads
- I/O threads (working on java.io or java.net)
- Blocked and Deadlocked threads (see also SpyGlass Thread Lock Monitor for more details on blocked threads and deadlocks)
- Sleeping Threads: stopped on java.Thread.sleep() method
- Native Threads: usually java.nio threads for J2EE systems
In the lower side you can see the list of most CPU consuming threads (active only if you check one from User Time and/or System Time):
- Thread ID/Name
- CPU % usage (100 means a full single logical CPU usage)
- CPU Time: how many CPU millis consumed from previous sampling
- User/System Time: how CPU was used (User code or OS code)
- Blocked Time: how many millis thread passed in blocked state
- Wait time: the same in wait state
- StackTrace: Thread stack trace during sampling process
Pay attention that collecting User and System Time is a time consuming activity for the server so you have to explicitly enable them manually. To limit impact on server activity User and System Time interval is about 10 seconds. We estimate that with a 500 threads systems collecting CPU time will require about 200ms of server CPU time.
VisualVM 1.3.1 or better is required to run SpyGlass Garbage Collector Analyzer. You can look at your bin directory inside your JDK 1.6.x or better or you can download it by yourself (http://visualvm.java.net/)
This plugin cannot be distributed with other products or inside any commercial product package.
See license for more details.
SpyGlass Thread Monitor