Several essential command-line tools are available for monitoring and managing Java Virtual Machines (JVMs). These include jps, jstat, jinfo, jmap, and jstack. To use these tools, you typically need to install the openjdk-devel-debug package.
You can install it using the following command:
sudo yum install -y java-1.8.0-openjdk-devel-debug
Now let's explore each of these tools in detail:
1. jps – Similar to the Linux 'ps' command, this tool lists all running Java processes. Common options include:
- -l: Displays the full package name of the main class or the full path of the JAR file.
- -m: Shows the arguments passed to the main method.
- -v: Displays JVM parameters.
Example: jps -lvm
2. jstat – A lightweight utility that monitors JVM statistics, especially useful for detecting memory issues. The basic syntax is:
jstat [option] [-t] [-h
Where vmid
refers to the process ID (PID) of the Java application, interval
is the time in milliseconds between samples, and count
is the number of samples to take.
Common usage example:
jstat -gcutil 20659 1000 2
The output might look like this:
S0 S1 E O M CCS YGC YGCT FGC FGCT GCT 0.00 99.38 65.57 3.61 97.37 89.84 1 0.015 0 0.000 0.015
Here’s what the columns mean:
- S0: Percentage of used space in Survivor Space 0.
- S1: Percentage of used space in Survivor Space 1.
- E: Percentage of used space in Eden space.
- O: Percentage of used space in Old generation.
- M: Percentage of used space in Metaspace.
- YGC: Number of Young Garbage Collections since the application started.
- YGCT: Total time spent on Young GCs.
- FGC: Number of Full GCs.
- FGCT: Time spent on Full GCs.
- GCT: Total GC time.
3. jinfo – Used to display JVM configuration parameters. Example:
jinfo -flags 20659
This will show details like heap size, garbage collection settings, and other JVM flags.
4. jmap – Used to inspect the memory usage of a Java process. Common commands include:
jmap pid
: Prints a summary of memory usage.jmap -heap pid
: Shows detailed information about the Java heap.jmap -histo:live pid
: Lists object counts, with "live" indicating active objects.jmap -histo pid > mem.txt
: Outputs object counts to a file.jmap -dump:format=b,file=mem.dat pid
: Exports the entire heap to a file for analysis.
5. jstack – This tool is used to print thread stacks of a running Java process. It's particularly useful when diagnosing deadlocks or performance issues. Usage is simple:
jstack pid
Outdoor Fixed Advertising Led Billboards
Outdoor fixed advertising LED billboards are large electronic display screens that are used for advertising purposes. These billboards are typically installed in high-traffic areas such as highways, city centers, and sports stadiums to maximize visibility and reach a wide audience. outdoor fixed advertising LED billboards offer a powerful and effective advertising platform that can reach a large audience and deliver dynamic and engaging content. Hot-selling pixels are p4/p5/p6/p8/p10.
Outdoor Fixed Advertising Led Billboards,Outdoor Fixed Led Billboards Waterproof,Outdoor Display Advertising,Outdoor Movie Screen Rental
Guangzhou Cheng Wen Photoelectric Technology Co., Ltd. , https://www.cwledwall.com