Java common operation and maintenance commands

dump online .jfr file command

jcmd < pid > VM.unlock_commercial_features
jcmd < pid > JFR.start name=2min.jfr settings=profile delay=3s duration=2m filename=/opt/2_min.jfr compress=true

Can be parsed by java8 jmc.exe file

Manually open

-Djava.rmi.server.hostname=localhost
-Dcom.sun.management.jmxremote.port=18888
-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.managementote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder

Start java in the background and debug remotely

nohup java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -XX:+UseConcMarkSweepGC -Dspring.profiles.active=fat,server2 -Dregistry.server.id=127.0.0.1:3 -jar app-server-0.0.2.jar &

Guess you like

Origin blog.csdn.net/u013202238/article/details/109338761