If there is one tool that have almost all what is needed for monitoring, troubleshooting and tuning Java apps, that will be OpenJDK Mission Control.

There are several reasons why JMC will be hot topic in Java events from now on:

  • More than 95% of all issues related to JVM, application servers, deployed apps and even OS can be resolved by leveraging openJDK Mission Control
  • less than 3% overhead makes JFR ideal for production environments
  • Java Flight Recorder is Open Sourced now and it’s bundled with OpenJDK 11
  • Java Mission Control went Open Source too, thus both components can be used in production

Although latest version 7.1 is in Early Access state, even now you can play with and figure out what you can expect in the final release.

From Automated Analysis results, through the spectacular views of most important events, flexible configuration, filtering only events of interest, this tool will become (and already is) pearl in Java developing, monitoring, troubleshooting and tuning.

Equipped with GPL license, it’s not difficult to imagine that the whole ecosystem will be created around with dozens of plug-ins (in Oracle JDK version of JMC there are just a few plugins available like JConsole, DTrace Recorder, WebLogic Tab Pack and few more).

I’ll write more about JMC in the future.

In case you cannot wait, in Java conference in Zagreb, Croatia, on 23rd February 2019, I’ll talk more about JMC.

Below you can find the conference link with all details:

https://javantura.com

 

Here I’ll describe how you can install OpenJDK JMC properly, since on many sites I’ve found that provided instructions are not 100% accurate (probably due to the constant change in repo), and currently normal installation procedure doesn’t exist (OpenJDK Mission Control is still in development phase).

 

1. Installing Mercurial

root@performatune.com:~>dnf install mercurial

Dependencies resolved.
==============================================================================================================================================================================================================================================================
 Package                                                       Arch                                                       Version                                                            Repository                                                  Size
==============================================================================================================================================================================================================================================================
Installing:
 mercurial                                                     x86_64                                                     4.5.3-1.fc29                                                       fedora                                                     4.3 M

Transaction Summary
==============================================================================================================================================================================================================================================================
Install  1 Package

Total download size: 4.3 M
Installed size: 19 M

Downloading Packages:
mercurial-4.5.3-1.fc29.x86_64.rpm                                                                                                                                                                                             1.6 MB/s | 4.3 MB     00:02    
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                         981 kB/s | 4.3 MB     00:04     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                                      1/1 
  Installing       : mercurial-4.5.3-1.fc29.x86_64                                                                                                                                                                                                        1/1 
  Running scriptlet: mercurial-4.5.3-1.fc29.x86_64                                                                                                                                                                                                        1/1 
  Verifying        : mercurial-4.5.3-1.fc29.x86_64                                                                                                                                                                                                        1/1 

Installed:
  mercurial-4.5.3-1.fc29.x86_64                                                                                                                                                                                                                               

Complete!

2. Installing Apache Maven

#Download: apache-maven-3.6.0-bin.tar.gz
#from https://maven.apache.org/download.cgi


root@performatune.com:/opt>tar xvfz apache-maven-3.6.0-bin.tar.gz



#Edit .bash_profile and add Maven in the PATH 
export PATH=/opt/apache-maven-3.6.0/bin:$PATH

#Apply new environment 
user@performatune.com:~>. .bash_profile



#Check if Maven is installed correctly 

user@performatune.com:~>mvn -v
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: /opt/apache-maven-3.6.0
Java version: 11.0.1, vendor: Oracle Corporation, runtime: /usr/java/openjdk-11.0.1
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.19.13-300.fc29.x86_64", arch: "amd64", family: "unix"

3. Make sure JDK8 environment is set in terminal and then execute:

hg clone http://hg.openjdk.java.net/jmc/jmc/


user@performatune.com:~/Downloads/xxx>hg clone http://hg.openjdk.java.net/jmc/jmc/
destination directory: jmc
requesting all changes
adding changesets
adding manifests
adding file changes
added 117 changesets with 5318 changes to 4213 files                                                                                                                                                                                                                                      
new changesets a76a464b3764:0e7f3f9e078c
updating to branch default
4199 files updated, 0 files merged, 0 files removed, 0 files unresolved

4. Get the third party dependencies into a local p2 repo and make it available on localhost:

user@performatune.com:~/Downloads/xxx>cd jmc/releng/third-party/

user@performatune.com:~/Downloads/xxx/jmc/releng/third-party>mvn p2:site
Generation completed with success [0 seconds].
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.454 s
[INFO] Finished at: 2019-01-14T23:05:05+01:00
[INFO] ------------------------------------------------------------------------

5. Get third party dependencies – Part 2

user@performatune.com:~/Downloads/xxx/jmc/releng/third-party>mvn jetty:run

6. Leave the current terminal open, and then open a new terminal (JDK8 env) ad then in another terminal (in the project root):

user@performatune.com:~/Downloads/xxx/jmc>cd core/


user@performatune.com:~/Downloads/xxx/jmc/core>mvn clean install

------------------------------------------------------------------------
[INFO] Reactor Summary for missioncontrol.core 7.1.0-SNAPSHOT:
[INFO] 
[INFO] missioncontrol.core ................................ SUCCESS [ 24.295 s]
[INFO] common ............................................. SUCCESS [ 19.272 s]
[INFO] flightrecorder ..................................... SUCCESS [  1.861 s]
[INFO] flightrecorder.rules ............................... SUCCESS [  1.328 s]
[INFO] flightrecorder.rules.jdk ........................... SUCCESS [  1.657 s]
[INFO] missioncontrol.core.tests .......................... SUCCESS [  0.006 s]
[INFO] common.test ........................................ SUCCESS [ 35.319 s]
[INFO] flightrecorder.test ................................ SUCCESS [  2.539 s]
[INFO] flightrecorder.rules.test .......................... SUCCESS [  0.621 s]
[INFO] flightrecorder.rules.jdk.test ...................... SUCCESS [  5.822 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:58 min
[INFO] Finished at: 2019-01-14T23:12:55+01:00
[INFO] ------------------------------------------------------------------------



user@performatune.com:~/Downloads/xxx/jmc/core>cd ..

user@performatune.com:~/Downloads/xxx/jmc>mvn package


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  05:50 min
[INFO] Finished at: 2019-01-14T23:19:52+01:00
[INFO] ------------------------------------------------------------------------

7. Start JMC to check if it is working properly

#Make sure you set JAVA_HOME to point to OpenJDK 11 

user@performatune.com:~/Downloads/jmc/target/products/org.openjdk.jmc/linux/gtk/x86_64>echo $JAVA_HOME 
/usr/java/openjdk-11.0.1


#Start JMC console 
export JAVA_HOME=/usr/java/openjdk-11.0.1
export PATH=$JAVA_HOME/bin:$PATH
user@performatune.com:~/Downloads/jmc/target/products/org.openjdk.jmc/linux/gtk/x86_64>./jmc -vm $JAVA_HOME/bin

Summary:

If you don’t have a source code of some application, and you need to troubleshoot and to solve the problem on production, you’ll start appreciate this phenomenal tool.

OpenJDK Mission Control is now available as Open Source software and no license is needed for it’s usage.

For that reason I expect to see tremendous growth of it’s usage, growth in a number and quality of available plug-ins that will help the whole ecosystem around JVM from enterprise applications up to the Big Data, Machine Learning, AI and High Performance Computing.

Time will show if I’m right, although in this case chances are more than promising.



Get notified when a new post is published!

Loading

Comments

There are no comments yet. Why not start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.