====== jcmd ====== * [[https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr006.html|jcmd]] * 현재 실행중인 JVM 에 명령을 내려 정보를 보거나 행위를 할 수 있다. ===== 예제 ===== $ jcmd # java process 목록이 출력됨. 5485 sun.tools.jcmd.JCmd 2125 MyProgram $ jcmd 2125 help # 혹은 jcmd MyProgram help # 해당 VM에 대해 실행할 수 있는 명령 목록이 나옴. 2125: The following commands are available: JFR.stop JFR.start JFR.dump JFR.check VM.native_memory VM.check_commercial_features VM.unlock_commercial_features ManagementAgent.stop ManagementAgent.start_local ManagementAgent.start Thread.print GC.class_stats GC.class_histogram GC.heap_dump GC.run_finalization GC.run VM.uptime VM.flags VM.system_properties VM.command_line VM.version help $ jcmd MyProgram Thread.print # Thread.print 명령 실행 $ jcmd MyProgram VM.version 2125: Java HotSpot(TM) 64-Bit Server VM version 24.45-b08 JDK 7.0_45 현재 Tomcat 프로세스 전체 JVM 버전 출력하기 jcmd | grep Bootstrap | cut -f1 -d' ' | xargs -I % jcmd % VM.version ===== 참조 ===== * [[https://www.javacodegeeks.com/2019/02/jcmd-circa-jdk-11.html|jcmd, Circa JDK 11]] * [[https://blog.frankel.ch/openjdk-11-tools-trade/|OpenJDK 11, tools of the trade]] * [[https://dzone.com/articles/jvm-tuning-using-jcmd|JVM Tuning Using jcmd - DZone Java]]