Remotely monitor Java programs with JVISUALVM

Source: Internet
Author: User

Java-JVISUALVM Debugging Java programs, you can view CPU, memory, classes and threads and other information, can also be dump, is undoubtedly a tool

Remote debugging required because the client is Windows, the server is Linux, and is the smallest installed Linux with no graphical interface

One, client: Windows

Open%java_home%/bin/jvisualvm.exe, in the "Remote" node, right-click, "Add Remote Host" as follows:

Enter the host IP address, modify the display name, click OK, as follows:

Second, the server: Linux

Create a new policy file under $java_home/bin/:

[Email protected]  bin]$ touch jstatd.all.policy[[email protected]-sha1-flk-

Enter the following content:

" File:/usr/java/default/lib/tools.jar " {       permission java.security.AllPermission;   };

Start JSTATD:

[Email protected] Bin]$./jstatd-j-djava.security.policy=./jstatd.all.policy

At this point the client can see all the Java programs running on the server, as follows:

Double-click a Java program node to see specific CPU, memory, class, and thread information

Third, the pits encountered

3.1 Plug-in installation

JVISUALVM can install plug-ins, but when used, found that the default plug-in provides the site is no longer available:

Direct access through the browser, found that the site is no longer available:

http://www.oracle.com/splash/java.net/maintenance/index.html

The new address has been migrated to GitHub:

HTTPS://visualvm.github.io/pluginscenters.html

Download the corresponding plug-in from the version locally, then install it locally, as an example of installing visual GC, as follows:

After installation, you can find a more tab page for the visual GC:

The memory allocation in the JVM can be visually observed

3.2 CPU view, crawl dump

Using this remote way, you can not view the CPU, unable to crawl the dump, so the limitations are very large, or should be used in a local way more secure

Remotely monitor Java programs with JVISUALVM

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.