]> git.sven.stormbind.net Git - sven/jattach.git/blob - README.md
update control file
[sven/jattach.git] / README.md
1 ## jattach
2
3 ### JVM Dynamic Attach utility
4
5 The utility to send commands to remote JVM via Dynamic Attach mechanism.
6
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.
9
10 This is the lightweight native version of HotSpot Attach API  
11 https://docs.oracle.com/javase/8/docs/jdk/api/attach/spec/
12
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
24
25 ### Examples
26 #### Load JVMTI agent
27
28     $ jattach <pid> load <.so-path> { true | false } [ options ]
29
30 Where `true` means that the path is absolute, `false` -- the path is relative.
31
32 `options` are passed to the agent.
33
34 #### List available jcmd commands 
35
36     $ jattach <pid> jcmd "help -all"
37
38 ### Installation
39 #### FreeBSD
40
41 On FreeBSD, you can use the following command to install `jattach` package:
42
43     $ pkg install jattach
44
45 #### Alpine Linux
46
47 On Alpine Linux, you can use the following command to install `jattach` package from the edge/testing repository:
48
49     $ apk add --no-cache jattach --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/
50
51 #### Archlinux
52
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`:
54
55     $ yay -S jattach