Skip to main content

JVM introspection

v0.1.12

JVM diagnostics via jcmd/jstack/jmap/jstat/JFR. Requires runner uid to match the JVM process owner (or CAP_SYS_PTRACE) — actions return a permission error cleanly when uid doesn't match.

16 allowed by default 1 denied by default
Pack ID
java-jvm
Vendor
emisar
OS
linux
Actions
17
Required binaries. Install these on the host before relying on the pack — an action that calls a missing one fails at run time.
jcmd

Install

emisar pack install fetches this pack, re-validates it, and verifies its content hash against the --hash below — the exact bytes this page was rendered against, so a tampered copy is rejected — before copying it into the runner's packs dir. The command reloads a running daemon itself; no manual restart.

on the runner host
sudo emisar pack install java-jvm --hash sha256:2060fc8e75684d5d0ae0bd6456fb56284eb72e77c93f116ac3e867865724c787

Actions 17 total

View on GitHub
  • jvm.classloader_stats exec low

    jcmd VM.classloader_stats

    Show per-classloader statistics — instance count, loaded classes, and chunk/block bytes. Use to spot a class-loader leak. Uses the attach API, so it works on JVMs running -XX:+PerfDisableSharedMem (the Cassandra default) where jvm.jstat_class fails.

    View source on GitHub
  • jvm.heap_dump exec critical

    jmap -dump:live (heap dump)

    Triggers a full GC, then dumps the live heap to /tmp/<pid>-heap.hprof. Can be many GB. Causes a long STW pause (seconds). Use only when you have analyst capacity to load the .hprof and disk space to hold it.

    View source on GitHub
  • jvm.heap_summary exec low

    jcmd GC.heap_info

    Show heap geometry — used/committed per generation (Eden, Survivor, Old, Metaspace) via the attach API. Works on JDK 9+ where `jmap -heap` was removed, and on JVMs running -XX:+PerfDisableSharedMem (e.g. Cassandra).

    View source on GitHub
  • jvm.jcmd_gc_run exec medium

    jcmd <pid> GC.run

    Trigger a full GC. Use to compare heap usage before/after, or to force collection ahead of a heap dump for cleaner output. Causes a pause whose length depends on heap size + collector tuning.

    View source on GitHub
  • jvm.jfr_dump exec medium

    Dump active JFR recording

    Dumps the active "emisar" recording to its current file. Use mid-flight to grab a snapshot without stopping the recording.

    View source on GitHub
  • jvm.jfr_start exec medium

    Start a Java Flight Recording

    Starts a 60-second Java Flight Recording named "emisar". JFR is low-overhead (~1%). Pair with `jvm.jfr_dump` to retrieve the recording, then `jvm.jfr_stop` to end it.

    View source on GitHub
  • jvm.jfr_stop exec medium

    Stop active JFR recording

    Stops the "emisar" recording and finalizes the .jfr file.

    View source on GitHub
  • jvm.jmap_histo_live exec medium

    jmap -histo:live (top 50)

    List top classes by retained-heap size after a forced full GC. Use to find the leak candidate.

    View source on GitHub
  • jvm.jstack exec low

    jstack -l (thread dump)

    Dump full thread state with lock info. The canonical "what are all my threads doing?" diagnostic.

    View source on GitHub
  • jvm.jstack_blocked exec low

    jstack filtered to BLOCKED threads

    Runs jstack and filters output to threads in BLOCKED state plus their lock owners. Use to find deadlocks fast.

    View source on GitHub
  • jvm.jstat_class exec low

    jstat -class

    Show class-loader stats — loaded class count and bytes. Use to spot a class-loading leak. Needs jvmstat perf data: fails with "<pid> not found" on JVMs running -XX:+PerfDisableSharedMem (the Cassandra default) — there use jvm.jmap_histo_live (live-object histogram) or JFR instead.

    View source on GitHub
  • jvm.jstat_gc exec low

    jstat -gc (10 samples)

    Show ten 1-second samples of GC stats. Surfaces young + old GC time, survivor sizes, metaspace usage. Use to spot a GC storm. Needs jvmstat perf data: fails with "<pid> not found" on JVMs running -XX:+PerfDisableSharedMem (the Cassandra default) — there use jvm.heap_summary for heap state, or JFR (jvm.jfr_start / jvm.jfr_dump) for GC behavior over time.

    View source on GitHub
  • jvm.perfdata exec low

    jcmd PerfCounter.print

    Show JVM performance counters — class loading, JIT, GC. Cheaper than jstat for one-shot. Reads the same jvmstat perf data as jstat: fails on JVMs running -XX:+PerfDisableSharedMem (the Cassandra default) — there use the attach-based reads (jvm.heap_summary, jvm.vm_flags, jvm.jstack) or JFR.

    View source on GitHub
  • jvm.thread_count exec low

    OS thread count for a JVM

    Counts /proc/<pid>/task entries — fastest way to spot "do we have an unbounded thread pool?"

    View source on GitHub
  • jvm.vm_flags exec low

    jcmd VM.flags

    Returns the JVM command-line and tuning flags. Use to confirm "is -Xmx set to what we expect?"

    View source on GitHub
  • jvm.vm_system_properties exec low

    jcmd VM.system_properties

    Dump every -Dkey=value system property the JVM was started with (jcmd VM.system_properties = System.getProperties()). Use to confirm config overrides took effect — but note this deliberately surfaces every launch -D property, which routinely carries secrets (spring.datasource.password, javax.net.ssl.keyStorePassword, JDBC / cloud credentials). Scope it by policy. The runner's redaction is a fail-closed backstop, not a guarantee — it is pattern-bound and can miss a bespoke secret whose name and value match no rule.

    View source on GitHub
  • jvm.vm_uptime exec low

    jcmd VM.uptime

    Show how long this JVM has been running.

    View source on GitHub