下载

1
2
3
4
root@platform-green-5d77977ffc-nw8dm:/# curl -O https://arthas.aliyun.com/arthas-boot.jar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 138k 100 138k 0 0 367k 0 --:--:-- --:--:-- --:--:-- 367k

启动

启动后按1,1为进程ID

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
root@platform-green-5d77977ffc-nw8dm:/# java -jar arthas-boot.jar
[INFO] JAVA_HOME: /usr/local/openjdk-11
[INFO] arthas-boot version: 3.7.2
[INFO] Found existing java process, please choose one and input the serial number of the process, eg : 1. Then hit ENTER.
* [1]: 1 platform-0.5.6-SNAPSHOT.jar
1
[INFO] Start download arthas from remote server: https://arthas.aliyun.com/download/3.7.2?mirror=aliyun
[INFO] Download arthas success.
[INFO] arthas home: /root/.arthas/lib/3.7.2/arthas
[INFO] Try to attach process 1
Picked up JAVA_TOOL_OPTIONS:
[INFO] Attach process 1 success.
[INFO] arthas-client connect 127.0.0.1 3658
,---. ,------. ,--------.,--. ,--. ,---. ,---.
/ O \ | .--. ''--. .--'| '--' | / O \ ' .-'
| .-. || '--'.' | | | .--. || .-. |`. `-.
| | | || |\ \ | | | | | || | | |.-' |
`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----'

wiki https://arthas.aliyun.com/doc
tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html
version 3.7.2
main_class
pid 1
time 2024-09-05 11:31:56

查看内存信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[arthas@1]$ memory
Memory used total max usage
heap 2819M 10240M 10240M 27.54%
g1_eden_space 816M 6220M -1 13.12%
g1_old_gen 1771M 3788M 10240M 17.30%
g1_survivor_space 232M 232M -1 100.00%
nonheap 349M 367M 1256M 27.85%
codeheap_'non-nmethods' 1M 2M 5M 31.82%
metaspace 204M 215M 512M 39.98%
codeheap_'profiled_nmethods' 65M 67M 117M 56.26%
compressed_class_space 23M 27M 504M 4.62%
codeheap_'non-profiled_nmethods' 54M 54M 117M 46.12%
mapped 0K 0K - 0.00%
direct 69M 69M - 100.00%