JVM Monitors hive Process

Source: Internet
Author: User
Tags jconsole

JVM Monitoring

Jvm:java Virtual machine (Java VM)

Monitoring tools:

The JDK comes with the following two examples, as well as other types of monitoring tools:

Jconsole.exe, Jvisualvm.exe (real-time monitoring of JDK's own)

Ibm:

IBM Pattern Modeling and Analysis Tool for Java garbage Collector (Ga441.jar)

IBM Heapanalyzer (Ha456.jar)

How to use: real-time Remote monitoring parameters:

Real-time monitoring tools Jconsole.exe, Jvisualvm.exe can be used for real-time monitoring of Java program processes, real-time information including the process of real-time CPU, memory (heap), threads and classes, if the program is located on the machine to open a port, Take this monitored hive process for example:

Node: 172.19.189.24

Monitoring Linux Port usage:

NETSTAT-TUNLP |grep 2990 There's nothing out there. Indicates that the port is not in use and can be used

Modify the hive JVM parameter to enable JMX remote connection:

-dcom.sun.management.jmxremote

-dcom.sun.management.jmxremote.port=2990

-dcom.sun.management.jmxremote.ssl=false-dcom.sun.management.jmxremote.authenticate=false

The above JVM parameters are configuration parameters that enable JMX remote connections.

GC-related parameters:

Information files used to generate the memory heap (which can be analyzed with two tools provided by IBM):

A few more parameters are added below to generate GC related files:

-verbose:gc

-xx:+printgcdetails

-xx:+printgcdatestamps-xloggc:/var/log/hive/gc.hiveserver2.log-' date+ '%y%m%d%h%m%s '-XX:+ Heapdumponoutofmemoryerror-xx:heapdumppath=/var/log/hive

-xx:+disableexplicitgc-xx:+usecompressedoops

After adding, restart the Hive service, Ps–ef|grep hive on 24 to see the details of the hive process, as shown in:

In the process information, you can see that these parameters have been added, at this point can be remotely connected to monitor:

JVISUALVM Operation Example:

Open Jvisualvm.exe (My directory is: C:\Program files\java\jdk1.7.0_25\bin)

Follow these steps:

Jconsole is used in the same way as JVISUALVM:

The interface after opening is as follows:

Examples of IBM analysis tools:

A few GC parameters will generate GC files, the contents of the JVM real-time garbage collection situation, in addition, when a memory overflow occurs when the memory heap dump file generated, the specific operation example and open after the situation is roughly as follows a few graphs:

Open (Ga441.jar, analyze Memory garbage collection):

When you select a file to open, you can see real-time changes in memory:

Open Ha456.jar, analyze the situation of the memory dump file, because of the relatively large, when opened to allocate more memory than the size of the file, as follows:

When you open, you can see the memory of OutOfMemory:

JVM Monitors hive Process

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.