LoginSignup
11
12

More than 5 years have passed since last update.

JMC(Java Mission Control)リモート接続の方法

Posted at

Java Mission Controlクライアントは、リモートで実行しているJVMに接続し、JFR(Java Flight Recorder)記録を取得することができます。
2016-06-06_175819.png

サーバー側の設定

JVMのリモート接続は、JMXRMI (JMX over RMI) が使用されます。それを有効するには、以下のJVMオプションが使用されます。
-Dcom.sun.management.jmxremote.port
-Dcom.sun.management.jmxremote.authenticate
-Dcom.sun.management.jmxremote.ssl

接続認証なしでJVMの起動例:

$java -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=7091 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false myApp

又は、JAVA_TOOL_OPTIONSで指定する。

$set JAVA_TOOL_OPTIONS "-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=7091 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

※JFRを有効には以下のオプションも必要です。
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder

クライアント側の設定

1.%JAVA_HOME%\bin\jmc.exeからJMC クライアントを起動する。
2016-06-06_180455.png

2.「ファイル」⇒「接続」でJVM接続画面を開き、接続情報を入力する。
2016-06-06_182134.png

3.「フライト記録の開始」画面で記録方法を入力する。
2016-06-06_182707.png

4.結果を確認する。
2016-06-06_183449.png

11
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
12