Install Jitwatch under Linux

Source: Internet
Author: User

Jitwatch is a log parser for Java hotspot JIT, which we can use to understand the behavior of Java hotspot JIT . This article is mainly about its installation, the steps are as follows:

(1) Download the Jitwatch jar Package:

wget https://adopt-openjdk.ci.cloudbees.com/job/jitwatch/jdk=JDK_1.7/ws/jitwatch-1.0.0-SNAPSHOT-JDK_1.7.tar.gz

This is the JDK1.7 version of the download. Unzip to get the jar package.

(2) get Jitwatch 's dependent jar package:

wget Https://github.com/AdoptOpenJDK/jitwatch/archive/master.zip

Unzip the file and get the associated jar package from the Lib directory.

(3) Place all the previously obtained jar packages in one directory:

(Jitwatch.out is generated by running the following command)

(4) Run the following command to start Jitwatch:

Java-cp/usr/lib/jvm/jdk1.7.0_67/lib:/usr/lib/jvm/jdk1.7.0_67/jre/lib/jfxrt.jar:jitwatch-1.0.0-snapshot.jar: Slf4j-api-1.7.7.jar:hamcrest-core-1.3.jar:logback-classic-1.1.2.jar:logback-core-1.1.2.jar Org.adoptopenjdk.jitwatch.launch.LaunchUI

The Jitwatch started:

Start Command analysis:

The/usr/lib/jvm/jdk1.7.0_67/lib:/usr/lib/jvm/jdk1.7.0_67/jre/lib/jfxrt.jar section needs to be set according to its own environment.

Org.adoptopenjdk.jitwatch.launch.LaunchUI can be obtained by analyzing the launchui.sh file for the Jitwatch project:

#!/bin/sh

Unamestr= ' uname '
If ["$JAVA _home" = "]; Then
If ["$unamestr" = ' Darwin ']; Then
Export java_home= '/usr/libexec/java_home '
Else
echo "Java_home have not been set."
Exit 0;
Fi
Fi

# Requires the jar to be built using
# MVN Package
# or
# ant Jar
#
#
# need to SET-XMX (max Heap) and-xx:maxpermsize
# If your hotspot.log references a lot of classes

Classpath= $CLASSPATH: Lib/logback-classic-1.1.2.jar
Classpath= $CLASSPATH: Lib/logback-core-1.1.2.jar
Classpath= $CLASSPATH: Lib/slf4j-api-1.7.7.jar
Classpath= $CLASSPATH: $JAVA _home/lib/tools.jar
Classpath= $CLASSPATH: $JAVA _home/jre/lib/jfxrt.jar
Classpath= $CLASSPATH: Target/jitwatch-1.0.0-snapshot.jar

"$JAVA _home/bin/java"-djava.library.path= $JAVA _home/lib/amd64-cp "$CLASSPATH" [email protected]Org.adoptopenjdk.jitwatch.launch.LaunchUI

(This article is a compilation code generated by the article using Hsdis and jitwatch to view analysis hotspot JIT compiler for an update on the Jitwatch installation part)

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Install Jitwatch under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.