Small set of tools for JVM troublshooting, monitoring and profiling.
SJK is a command line tool for JVM diagnostic, troubleshooting and profiling.
SJK exploits standard diagnostic interfaces of JVM (such as JMX, JVM attach and perf counters) and adds some more logic on top
useful for common troubleshooting cases. SJK can also be used as a library for building application specific diagnostic tools
or to enhance your code with self monitoring features.
wget https://training.ragozin.info/sjk.jar
-> sjk.jarjava -jar sjk.jar <cmd> <arguments>
java -jar sjk.jar --commands
java -jar sjk.jar --help <cmd>
Below a few command from SJK (full command reference).
Pools thread CPU usage of the target JVM and periodically reports to the console.
Similar to jmap -histo
.
These commands provide basic sample profiler capabilities. stcap
produces hyper-dense stack trace dump
(about 1000 compression rate compared to text format) and ssa
provides few reports over dump files.
stcpy
can copy data in archives produced by stcap
(e.g. merging dumps or filtering selected threads).
So far following reports are available:
Dump file can be also processed programatically.
This command allows you to do basic operations with MBean from command line.
It can:
*:*,name=CodeCacheManager
instead of java.lang:type=MemoryManager,name=CodeCacheManager
)Similar to jps
from JDK.
Report information about GC in real time. Data is retrieved via JMX.
Dumps all MBeans of target java process to JSON.