Use jrockit mission control to monitor Java program running performance

Source: Internet
Author: User

UseJrockit Mission ControlMonitoringJavaProgram Running Performance

 

Bea's jrockit JDK is developed by Bea. Using jrockit JDK to run Java programs, you can use the Mission Control Program to monitor the running status of Java programs.

Use Bea's jrockit Mission Control to view various metrics of the Java program during runtime. It helps you find the performance bottleneck of Java programs and the classes that cause problems. This helps us improve the performance of Java programs.

I. jrockit JDK

1. Install jrockit JDK. After installation, run Java-version in cmd.

We can see that the actual execution of Java is jrockit's JDK.

2. Some methods of starting Java programs use the operating system configuration to find JDK. Search for JDK like ant.

Therefore, you need to modify the operating system variable configuration.

Java_home = jrockit JDK installation directory

Ii. Mission Control Program

Two features, memory leakage and JRA record, are charged. You can also download the free license file for 1 hour.

1. First, start the mission control program. Under discovered-> local, the following are the process numbers and the Java processes started under each jrockit.

2. Start the Java program to be tested. Now, we can see a new process.

3. Right-click Start console to view the CPU and memory usage of the Java Process.

Note that the memory usage of the Java heap is much lower than that of the Java Process in the task manager of the operating system. Moreover, using mission control to monitor a Java Process also greatly increases the memory usage of the process.

 

3. Use the Mission Control Program to monitor the Java program by specifying the network port used by the Java program

1. Using JVM parameters, you can specify the port used by the Java program to use the Mission Control Program to monitor the Java program.

For example:

Java-xmanagement-DCOM. Sun. Management. jmxremote. Port = 7091-DCOM. Sun. Management. jmxremote. Authenticate = false-DCOM. Sun. Management. jmxremote. SSL = false

In this way, start a Java program to be monitored.

This specifies that port 7091 is used to start the Java program. (7091 is the default port used by the wizard of the Mission Control Program. We can use any other port)

2. Start the mission control program and click connectors to create a new connection.


Modify the host and port used by the program to the location and port used by the program to be monitored.

After that, you can monitor the running status of the Java program using the process method as shown above.

 

4. How to Use JVM parameters to start Java programs for ant jobs

<Java classname = "com. withub. bossservernio. Common. Code. launcher" failonerror = "true" fork = "yes" maxmemory =" 256 m ">

<Classpath refID = "bossservernio. classpath"/>

<Jvmarg value = "-xmanagement,-DCOM. sun. management. jmxremote. port = 7091,-DCOM. sun. management. jmxremote. authenticate = false,-DCOM. sun. management. jmxremote. SSL = false "/> </Java>

 

Ant's <Java> task has an element <jvmarg> that specifies the JVM parameter to be used. The value attribute is used to save JVM parameters.

Note that, instead of using spaces to separate JVM parameters, "," is used to separate multiple JVM parameters.

 

If you specify these parameters to start the Java program, it should be because you are not using Bea's jrockit JDK, but other JDK, such as Sun's JDK or IBM's JDK. Please refer to the first part to correctly install and configure Bea's jrockit JDK.
Related Article

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.