JDK Performance Analysis and Troubleshooting - Command Line

First, the command demonstrates
Login Host: 132.46.110.21
Docker PS -a | grep 'hub.ecs.com:6999/open_pro.*open-pro-apple2'
Docker Exec -it ID / bin / bash

jps

. 1 jinfo
jinfo. 1 | grep 'sun.java.command' // main method of the program parameters into the reference
jinfo 1 | grep 'Command line' // virtual machine system parameters, global parameters

jstat -gc 1 3s 10
jstat -gcutil 1 3s 10

# Simple facie case study follow-up have
to log test environment Host: 10.142.195.60
Docker PS -a | grep 'test.com:6999/open_2k'
Docker Exec -it ID / bin / bash

jstack 1 > stack1.txt
cat stack1.txt | grep 'java.lang.Thread.State'
cat stack1.txt | grep 'java.lang.Thread.State'| wc -l
cat stack1.txt | grep 'java.lang.Thread.State'|sort| uniq
线程状态:https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.State.html
New、Runnable(Runnable/Running)、Blocked(Blocked/WAITING/TIMED_WAITING)、Dead

# Needs analysis tools, to the naked eye unreadable
jmap -dump: format = b, file = dump2019.dump 1

Second, analysis of examples of
the first write java example code
a. Building large objects, timed sleep, blank [memory recovery], floating point calculation cycle [high CPU]
B. Overflow exception stack memory and heap (2 Exercise plus sleep)

1. Display the VisualVM
2. Display jps again, jstat-
3. Analysis Stack
4. Analysis dump

Guess you like

Origin www.cnblogs.com/DeskZero/p/11563038.html