This article is from: PerfMa Technology Community

PerfMa website

Java performance tuning is essential knowledge for every Java programmer to achieve technological advancement. For example: how to configure JVM parameters for an 8GB server? Are my JVM parameters reasonable? How to analyze memory Dump files? How to analyze thread Dump files? And so on… At one point or another, knowing how the Java Virtual machine (JVM) works can make everyday programming much more efficient, making it easier to fix common bugs.

To this end, PerfMa launched a Java application comprehensive health check tool, which presents boring configuration items, thread status and other information through a clear and beautiful visual interface, and analyzes and explains important indicators to help Java engineers optimize application performance more easily.

Let’s have a comprehensive understanding of how to use XPocket

“Xpocket-java Application Comprehensive Physical Examination”

A command line toolkit for Java applications. Through simple interaction, you can perform a comprehensive health check on your Java program.

  • JVM parameter optimization: Comprehensively diagnose JVM parameters, give comprehensive optimization suggestions, and provide optimized parameter list. Even beginner users who do not understand JVM parameters can also use this product to get a relatively reasonable parameter list.

  • Java thread analysis: more intuitive location of various threads, thread pool leakage problems. A more comprehensive presentation of threads, thread pools, locks, and other data interrelationships.

  • More features are being enhanced, please look forward to ~

Latest version, tool download address:

precondition

JDK 1.6 to 1.8, the environment variable JAVA_HOME has been set.

The Java process to be checked is ready

Start any Java process. Here is an example of a project to generate a Web Demo from the Spring Boot website. To show the effect, add some JVM parameters to it:

Java -xmx256m -xMS100m -xx :MetaspaceSize=256M -xx :MaxMetaspaceSize=256M -jar demo-0.0.1 -snapshot.jarCopy the code

Start the

Access the directory with the corresponding version number

  • For Windows users, double-click xpocket.bat

  • For Linux or MacOS users, run sh xpocket

Tourist mode is supported, but the analysis data of tourists will be made public, and it is recommended to use it after activation.

Attach a Java process

Once successfully activated (or logged in as a visitor), the currently running Java processes are automatically listed. Select a process, enter its serial number, and press Enter.

JAVA Thread Analysis

Type Thread, press Enter. A thread Dump is performed and analyzed. You can view thread status statistics, thread pool profile, and lock profile of the current process.

You can access the XSheepdog – Java Thread Dump Analysis page as prompted to obtain a detailed thread analysis report.

JVM parameter optimization

Type args and press Enter.

You can view the JVM parameters of the process and generate optimization recommendations based on the actual environment information (memory, CPU, operating system, JDK version).

You can visit the XXfox-Java VM Parameter Analysis page as prompted to obtain detailed JVM parameter optimization suggestions.

Let’s learn:

JVM Parameters in PerfMa KO series

A thread strike weird event