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