Let's touch Java Mission Control 7.0.0 Early-Access which became OSS: Introduction

Introduction

The EA version of Java Misstion Control (JMC) is finally out! JMC is a tool for analyzing the operational details of Java applications. JMC had to use the Oracle paid version (Product Editions) for business use. It is mostly used as a set with Java Flight Recorder (JFR), but well ... For me who does not use the paid version, it was unrelated, but it will be incorporated into OpenJDK side from Java 11 It was.

--Overview of JMC and JFR --http://www.oracle.com/webfolder/technetwork/jp/ondemand/ddd2014/B2-1.pdf

And ... finally, the EA version of the ** JMC 7.0.0 UPL license is out! !! !! ** ** JMC 7.0.0 EA Builds - http://jdk.java.net/jmc/

JMC builds These early-access, open-source builds are provided under the UPL .

I've had a lot of problems with the Oracle JDK, but I'm very happy to be able to use paid features in this way.

Try out

I will try the following two things.

--Real-time monitoring with JMX --Recording and reference with Java Flight Recorder

From the result, it worked fine.

Constitution

Same as below. I'm running an application with basic GKE ... How to use jvisualvm in GKE + Java environment-https://qiita.com/h-r-k-matsumoto/items/6bd4ba191208745e012b

  +--------+      +-------------------------+     +-----------------------+
  |        |      |                         |     |                       |
  |   PC   | +--> |   GCE: tunnel serever   | +-> |   GKE: applications   |
  |        |      |                         |     |                       |
  +--------+      +-------------------------+     +-----------------------+

--Monitoring with a PC terminal. And visualization. The GKE application will be monitored. --The PC terminal is Windows 10. GKE is 1.10.5-gke.3. --The tunnel server is CentOS 7.

Application to run

application

The application to run is  https://github.com/h-r-k-matsumoto/spring-boot-sample/tree/java11 is. * It is a java 11 tag.

Advance preparation

Install JMC

Download the binary from the following site. In my case, Windows / x64 exe (sha256: 6888816db19c1ff7db9091a623b252ef222e83a3e9ac54dbce8982ff66875042) I dropped it and installed it according to the wizard. http://jdk.java.net/jmc/

I wasn't particularly addicted to it.

Create an SSH tunnel on a PC terminal

Digging a tunnel with SSH. Execute the following command on the PC machine.

> gcloud compute --project xxxxx ssh --zone xxxxx "tunnnel-server"  -- -N -D 7199

Start JMC on your PC terminal.

Just run jmc and the command. It's also in the start menu.

Real-time monitoring with JMX

Simply right-click on the target connection and click "Start JMX Console". image.png

As shown below, you can check the information + α information that could be viewed with jvisualvm etc. such as overview, memory, threads, etc.

image.png

I was connected!

Recording and reference with Java Flight Recorder

Right-click the target connection and click Start Flight Recording. The recording start screen is displayed. I will record for 10 minutes for the time being. image.png

Collection result

The screen will be displayed when the measurement period is over. I don't know how to look at it yet, but I was able to refer to the record safely for the time being! This will also make trouble tracking ... very easy? ?? ??

image.png

Where I was addicted

Proxy settings are done from the settings screen.

Even if you start it as shown below, proxy of socks protocol is not enabled.

jmc -J-DsocksProxyHost=localhost -J-DsocksProxyPort=7199 -J-DsocksNonProxyHosts=

On the network connection setting screen, you need to set the proxy according to the following procedure.

image.png

  1. Select "Manual operation" as the active provider
  2. In the SOCKS protocol, enter host = localhost and port = 7199.

Flight Recorder does not work with OpenJDK11-JRE-SLIM.

I used the image of ʻopenjdk: 11-jre-slim`, but when I start recording with Flight Recorder, the following error is displayed. image.png

I'm impatient. Eh commercial function ...? Like. It's okay. This was because the above image did not contain the required libraries. By using the image of ʻopenjdk: 11-jdk`, it works normally.

Reference material

Recommended Posts

Let's touch Java Mission Control 7.0.0 Early-Access which became OSS: Introduction
Let's touch on Java
Let's use Twilio in Java! (Introduction)