3 ### JVM Dynamic Attach utility
5 The utility to send commands to remote JVM via Dynamic Attach mechanism.
7 All-in-one **jmap + jstack + jcmd + jinfo** functionality in a single tiny program.
8 No installed JDK required, works with just JRE. Supports Linux containers.
10 This is the lightweight native version of HotSpot Attach API
11 https://docs.oracle.com/javase/8/docs/jdk/api/attach/spec/
13 [Supported commands](http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/812ed44725b8/src/share/vm/services/attachListener.cpp#l388):
14 - **load** : load agent library
15 - **properties** : print system properties
16 - **agentProperties** : print agent properties
17 - **datadump** : show heap and thread summary
18 - **threaddump** : dump all stack traces (like jstack)
19 - **dumpheap** : dump heap (like jmap)
20 - **inspectheap** : heap histogram (like jmap -histo)
21 - **setflag** : modify manageable VM flag
22 - **printflag** : print VM flag
23 - **jcmd** : execute jcmd command
28 $ jattach <pid> load <.so-path> { true | false } [ options ]
30 Where `true` means that the path is absolute, `false` -- the path is relative.
32 `options` are passed to the agent.
34 #### List available jcmd commands
36 $ jattach <pid> jcmd "help -all"
41 On FreeBSD, you can use the following command to install `jattach` package:
47 On Alpine Linux, you can use the following command to install `jattach` package from the edge/testing repository:
49 $ apk add --no-cache jattach --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/
53 [jattach](https://aur.archlinux.org/packages/jattach/) package can be installed from [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository) using one of [AUR helpers](https://wiki.archlinux.org/index.php/AUR_helpers), e.g., `yay`: