Diagnostic tools Xrebel and Arthas

Xrebel

// Add JVM parameters
-javaagent:"C:\Program Files\Java\xrebel.jar"
Copy the code

You can see the time consuming of each item, the speed of accessing the interface for the first time is obviously very slow, lazy loading problems. Here you can see that most of the time was spent verifying the SHA256 encryption.

Database disconnection is also reported

The function is still more comprehensive

Arthas

Java-jar starts directly, and then selects the thread to listen on

C:\Users\kyz\Downloads>java -jar arthas-boot.jar
[INFO] arthas-boot version: 3.4. 5
[INFO] Found existing java process, please choose one and input the serial number of the process, eg : 1. Then hit ENTER.
* [1] :11044 org.jetbrains.jps.cmdline.Launcher
  [2] :12616
  [3] :15836 ltd.wiki.water.WaterApplication
3
[INFO] Start download arthas from remote server: https:/ / arthas.aliyun.com/download/3.5.0?mirror=aliyun
[INFO] File size: 12.22 MB, downloaded size: 9.68 MB, downloading ...
[INFO] Download arthas success.
[INFO] arthas home: C:\Users\kyz\.arthas\lib\3.5. 0\arthas
[INFO] Try to attach process 15836
[INFO] Attach process 15836 success.
[INFO] arthas-client connect 127.0. 01. 3658
  ,---.  ,------. ,--------.,--.  ,--.  ,---.   ,---.
 /  O  \ |  .--. ' '-.. -'|'--' | / O \ '. -'|. -. | |'--'. '. | | | -. | | - | `. ` - | | | | | | \ \ | | | | | | | | | |. -'| ` --' `--'`--' The '-'   `--'` -'  `--'`--' `--'` -- -- -- -- --'


wiki       https://arthas.aliyun.com/doc
tutorials  https://arthas.aliyun.com/doc/arthas-tutorials.html
version    3.5. 0
main_class
pid        15836
time       2021-04-02 21:02:33

Copy the code
// View the helpCopy the code

// Check thread occupancy, Xrebel finds all threadsCopy the code

// Check the deadlock thread -b
[arthas@2997]$ thread -b
"Thread-3" Id=29 BLOCKED on java.lang.Object@3f20bf9 owned by "Thread-4" Id=30
    at com.spareyaya.jvm.service.DeadLockService.service1(DeadLockService.java:27)
    -  blocked on java.lang.Object@3f20bf9
    -  locked java.lang.Object@2fea801a <---- but blocks 1 other threads!
    at com.spareyaya.jvm.controller.JVMController.lambda$deadLock$0(JVMController.java:37)
    at com.spareyaya.jvm.controller.JVMController$$Lambda$456/748979989.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:748)
Copy the code
// Check whether memory leaks DashboardCopy the code