Skip to content
JVM Dynamic Attach utility
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Fix compilation on the ancient systems Jan 7, 2019
.gitignore RPM packaging Nov 30, 2016
LICENSE Initial commit Mar 29, 2016
Makefile Release 1.5 Jan 8, 2019 adapt the description... Jan 21, 2019
jattach.spec Updated spec for building rpm Feb 5, 2019


JVM Dynamic Attach utility

The utility to send commands to remote JVM via Dynamic Attach mechanism.

All-in-one jmap + jstack + jcmd + jinfo functionality in a single tiny program.
No installed JDK required, works with just JRE. Supports Linux containers.

This is the lightweight native version of HotSpot Attach API

Supported commands:

  • load : load agent library
  • properties : print system properties
  • agentProperties : print agent properties
  • datadump : show heap and thread summary
  • threaddump : dump all stack traces (like jstack)
  • dumpheap : dump heap (like jmap)
  • inspectheap : heap histogram (like jmap -histo)
  • setflag : modify manageable VM flag
  • printflag : print VM flag
  • jcmd : execute jcmd command


Load JVMTI agent

$ jattach <pid> load <.so-path> { true | false } [ options ]

Where true means that the path is absolute, false -- the path is relative.

options are passed to the agent.

List available jcmd commands

$ jattach <pid> jcmd "help -all"



On FreeBSD, you can use the following command to install jattach package:

$ pkg install jattach

Alpine Linux

On Alpine Linux, you can use the following command to install jattach package from the edge/community repository:

$ apk add --no-cache jattach --repository


jattach package can be installed from AUR using one of AUR helpers, e.g., yay:

$ yay -S jattach
You can’t perform that action at this time.