JVM在线分析-监控工具(jps, jstat, jstatd)

参考官方文档(jdk11)
https://docs.oracle.com/en/java/javase/11/tools/troubleshooting-tools-and-commands.html#GUID-CB44BFBA-E5F9-4D80-8EE8-28E9F16BC451

1. 监控工具(jps, jstat, jstatd)

jps

-q
Suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing a list of only local JVM identifiers.
-mlvV
-m displays the arguments passed to the main method. The output may be null for embedded JVMs.-l displays the full package name for the application's main class or the full path name to the application's JAR file.-v displays the arguments passed to the JVM.-V suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing a list of only local JVM identifiers.

jstat

(base) PS C:\Users\zishi> jstat -h
Usage: jstat --help|-optionsjstat -<option> [-t] [-h<lines>] <vmid> [<interval> [<count>]]Definitions:<option>      An option reported by the -options option<vmid>        Virtual Machine Identifier. A vmid takes the following form:<lvmid>[@<hostname>[:<port>]]Where <lvmid> is the local vm identifier for the targetJava virtual machine, typically a process id; <hostname> isthe name of the host running the target Java virtual machine;and <port> is the port number for the rmiregistry on thetarget host. See the jvmstat documentation for a more completedescription of the Virtual Machine Identifier.<lines>       Number of samples between header lines.<interval>    Sampling interval. The following forms are allowed:<n>["ms"|"s"]Where <n> is an integer and the suffix specifies the units asmilliseconds("ms") or seconds("s"). The default units are "ms".<count>       Number of samples to take before terminating.-J<flag>      Pass <flag> directly to the runtime system.-? -h --help  Prints this help message.-help         Prints this help message.

说明:

option:参数选项
-t:可以在打印的列加上Timestamp列,用于显示系统运行的时间
-h:可以在周期性数据输出的时候,指定输出多少行以后输出一次表头
vmid:Virtual Machine ID( 进程的 pid)
interval:执行每次的间隔时间,单位为毫秒
count:用于指定输出多少次记录,缺省则会一直打印

示例:

(base) PS C:\Users\zishi> jstat -gcutil -t -h5 24392 1000 20
Timestamp         S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT    CGC    CGCT     GCT2587.6   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122588.6   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122589.6   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122590.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122591.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.212
Timestamp         S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT    CGC    CGCT     GCT2592.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122593.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122594.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122595.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122596.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.212
Timestamp         S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT    CGC    CGCT     GCT2597.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122598.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122599.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122600.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122601.7   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.212
Timestamp         S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT    CGC    CGCT     GCT2602.8   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122603.8   0.00 100.00  14.61  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122604.8   0.00 100.00  15.17  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122605.8   0.00 100.00  15.17  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.2122606.8   0.00 100.00  15.17  11.16  97.36  91.49     12    0.202     0    0.000     6    0.010    0.212

-options说明

(base) PS C:\Users\zishi> jstat -options
-class
-compiler
-gc
-gccapacity
-gccause
-gcmetacapacity
-gcnew
-gcnewcapacity
-gcold
-gcoldcapacity
-gcutil
-printcompilation

class: Displays statistics about the behavior of the class loader.

(base) PS C:\Users\zishi> jstat -class 24392
Loaded  Bytes  Unloaded  Bytes     Time13370 25776.4        0     0.0       6.23

说明:

Loaded:加载class的数量
Bytes:所占用空间大小
Unloaded:未加载数量
Bytes:未加载占用空间
Time:时间

compiler: Displays statistics about the behavior of the Java HotSpot VM Just-in-Time compiler.

(base) PS C:\Users\zishi> jstat -compiler 24392
Compiled Failed Invalid   Time   FailedType FailedMethod9892      1       0    52.28          1 org/springframework/cglib/core/MethodWrapper$MethodWrapperKey$$KeyFactoryByCGLIB$$552be97a hashCode

说明:

Compiled:编译数量。
Failed:失败数量
Invalid:不可用数量
Time:时间
FailedType:失败类型
FailedMethod:失败的方法

gc: Displays statistics about the behavior of the garbage collected heap.

(base) PS C:\Users\zishi> jstat -gc 24392S0C    S1C    S0U    S1U      EC       EU        OC         OU       MC     MU    CCSC   CCSU   YGC     YGCT    FGC    FGCT    CGC    CGCT     GCT0.0   36864.0  0.0   36864.0 358400.0 309248.0  231424.0   14005.6   73932.0 72017.7 8704.0 7939.9     11    0.185   0      0.000   6      0.010    0.195

说明:

S0C:第一个幸存区的大小
S1C:第二个幸存区的大小
S0U:第一个幸存区的使用大小
S1U:第二个幸存区的使用大小
EC:eden区的大小
EU:eden区的使用大小
OC:老年代大小
OU:老年代使用大小
MC:方法区大小
MU:方法区使用大小
CCSC:压缩类空间大小
CCSU:压缩类空间使用大小
YGC:年轻代垃圾回收次数
YGCT:年轻代垃圾回收消耗时间
FGC:老年代垃圾回收次数
FGCT:老年代垃圾回收消耗时间
GCT:垃圾回收消耗总时间

gccapacity: Displays statistics about the capacities of the generations and their corresponding spaces.

(base) PS C:\Users\zishi> jstat -gccapacity 24392NGCMN    NGCMX     NGC     S0C   S1C       EC      OGCMN      OGCMX       OGC         OC       MCMN     MCMX      MC     CCSMN    CCSMX     CCSC    YGC    FGC   CGC0.0 8325120.0 395264.0    0.0 36864.0 358400.0    0.0   8325120.0   231424.0   231424.0      0.0 1114112.0  73932.0      0.0 1048576.0   8704.0     11     0     6

NGCMN:新生代最小容量
NGCMX:新生代最大容量
NGC:当前新生代容量
S0C:第一个幸存区大小
S1C:第二个幸存区的大小
EC:伊甸园区的大小
OGCMN:老年代最小容量
OGCMX:老年代最大容量
OGC:当前老年代大小
OC:当前老年代大小
MCMN:最小元数据容量
MCMX:最大元数据容量
MC:当前元数据空间大小
CCSMN:最小压缩类空间大小
CCSMX:最大压缩类空间大小
CCSC:当前压缩类空间大小
YGC:年轻代gc次数
FGC:老年代GC次数

gccause: Displays a summary about garbage collection statistics (same as -gcutil), with the cause of the last and current (when applicable) garbage collection events.

(base) PS C:\Users\zishi> jstat -gccause 24392S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT    CGC    CGCT     GCT    LGCC                 GCC0.00 100.00  89.14   6.05  97.41  91.22     11    0.185     0    0.000     6    0.010    0.195 G1 Evacuation Pause  No GC

说明:

这里是引用

gcnew: Displays statistics about the behavior of the new generation.

(base) PS C:\Users\zishi> jstat -gcnew 24392S0C    S1C    S0U    S1U   TT MTT  DSS      EC       EU     YGC     YGCT0.0 36864.0    0.0 36864.0  7  15 23552.0 358400.0 323584.0     11    0.185

说明:

S0C:第一个幸存区大小
S1C:第二个幸存区的大小
S0U:第一个幸存区的使用大小
S1U:第二个幸存区的使用大小
TT:对象在新生代存活的次数
MTT:对象在新生代存活的最大次数
DSS:期望的幸存区大小
EC:伊甸园区的大小
EU:伊甸园区的使用大小
YGC:年轻代垃圾回收次数
YGCT:年轻代垃圾回收消耗时间

gcnewcapacity: Displays statistics about the sizes of the new generations and their corresponding spaces.

(base) PS C:\Users\zishi> jstat -gcnewcapacity 24392NGCMN      NGCMX       NGC      S0CMX     S0C     S1CMX     S1C       ECMX        EC      YGC   FGC   CGC0.0  8325120.0   395264.0      0.0      0.0 8325120.0  36864.0  8325120.0   358400.0    11     0     6

说明:

NGCMN:新生代最小容量
NGCMX:新生代最大容量
NGC:当前新生代容量
S0CMX:最大幸存1区大小
S0C:当前幸存1区大小
S1CMX:最大幸存2区大小
S1C:当前幸存2区大小
ECMX:最大伊甸园区大小
EC:当前伊甸园区大小
YGC:年轻代垃圾回收次数
FGC:老年代回收次数

gcold: Displays statistics about the behavior of the old generation and metaspace statistics.

(base) PS C:\Users\zishi> jstat -gcold 24392MC       MU      CCSC     CCSU       OC          OU       YGC    FGC    FGCT    CGC    CGCT     GCT73932.0  72017.7   8704.0   7939.9    231424.0     14005.6     11     0    0.000     6    0.010    0.195

说明:

MC:方法区大小
MU:方法区使用大小
CCSC:压缩类空间大小
CCSU:压缩类空间使用大小
OC:老年代大小
OU:老年代使用大小
YGC:年轻代垃圾回收次数
FGC:老年代垃圾回收次数
FGCT:老年代垃圾回收消耗时间
GCT:垃圾回收消耗总时间

gcoldcapacity: Displays statistics about the sizes of the old generation.

(base) PS C:\Users\zishi> jstat -gcoldcapacity 24392OGCMN       OGCMX        OGC         OC       YGC   FGC    FGCT    CGC    CGCT     GCT0.0   8325120.0    231424.0    231424.0    11     0    0.000     6    0.010    0.195

说明:

OGCMN:老年代最小容量
OGCMX:老年代最大容量
OGC:当前老年代大小
OC:老年代大小
YGC:年轻代垃圾回收次数
FGC:老年代垃圾回收次数
FGCT:老年代垃圾回收消耗时间
GCT:垃圾回收消耗总时间

gcmetacapacity: Displays statistics about the sizes of the metaspace.

(base) PS C:\Users\zishi> jstat -gcmetacapacity 24392MCMN       MCMX        MC       CCSMN      CCSMX       CCSC     YGC   FGC    FGCT    CGC    CGCT     GCT0.0  1114112.0    73932.0        0.0  1048576.0     8704.0    11     0    0.000     6    0.010    0.195

说明:

MCMN:最小元数据容量
MCMX:最大元数据容量
MC:当前元数据空间大小
CCSMN:最小压缩类空间大小
CCSMX:最大压缩类空间大小
CCSC:当前压缩类空间大小
YGC:年轻代垃圾回收次数
FGC:老年代垃圾回收次数
FGCT:老年代垃圾回收消耗时间
GCT:垃圾回收消耗总时间

gcutil: Displays a summary about garbage collection statistics.

(base) PS C:\Users\zishi> jstat -gcutil 24392S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT    CGC    CGCT     GCT0.00 100.00  92.57   6.05  97.41  91.22     11    0.185     0    0.000     6    0.010    0.195

说明:

S0:幸存1区当前使用比例
S1:幸存2区当前使用比例
E:伊甸园区使用比例
O:老年代使用比例
M:元数据区使用比例
CCS:压缩使用比例
YGC:年轻代垃圾回收次数
FGC:老年代垃圾回收次数
FGCT:老年代垃圾回收消耗时间
GCT:垃圾回收消耗总时间

printcompilation: Displays Java HotSpot VM compilation method statistics.

(base) PS C:\Users\zishi> jstat -printcompilation 24392
Compiled  Size  Type Method10271    246    1 java/util/AbstractCollection toString

说明:

Compiled:最近编译方法的数量
Size:最近编译方法的字节码数量
Type:最近编译方法的编译类型。
Method:方法名标识。

参考:
https://docs.oracle.com/en/java/javase/11/tools/jstat.html#GUID-5F72A7F9-5D5A-4486-8201-E1D1BA8ACCB5

jstatd

待完善
https://docs.oracle.com/en/java/javase/11/tools/jstatd.html#GUID-FA737806-75CD-4EE7-A087-1CC4A5441870

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/139087.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【六袆 - Framework】Angular-framework;前端框架Angular发展的由来0001;

Angular发展介绍&#xff0c;Angular17新特性 官方文档Angular框架发展的由来何为结构化、模块化 Angular17新特性 English unit Embarking on the journey of deep technical learning requires a well-structured approach, applicable to any programming language. The key…

python---设计模式

python中设计模式-单例模式 基于__new__方法实现 第一个设计&#xff1a; class MySingleton:def __init__(self):passdef __new__(cls, *args, **kwargs):passmysingleton1 MySingleton() mysingleton2 MySingleton() print(mysingleton1) print(mysingleton2) print(id(…

第 117 场 LeetCode 双周赛题解

A 给小朋友们分糖果 I 动态规划&#xff1a;设 p [ k ] [ i ] p[k][i] p[k][i] 为将 i i i 个糖果分给 k k k 个小朋友的方案数&#xff0c;先求 p [ 2 ] [ i ] p[2][i] p[2][i] &#xff0c;再求 p [ 3 ] [ n ] p[3][n] p[3][n] class Solution { public:using ll long …

CH11_重构API

将查询函数和修改函数分离&#xff08;Separate Query from Modifier&#xff09; function getTotalOutstandingAndSendBill() {const result customer.invoices.reduce((total, each) > each.amount total, 0);sendBill();return result; }function totalOutstanding() …

写在 Chappyz 即将上所之前:基于 AI 技术对 Web3 营销的重新定义

前不久&#xff0c;一个叫做 Chappyz 的项目&#xff0c;其生态代币 $CHAPZ 在 Seedify、Poolz、Decubate、ChainGPT、Dao Space 等几大 IDO 平台实现了上线后几秒售罄&#xff0c;并且 Bitget、Gate.io、PancakeSwap 等几大平台也纷纷表示支持&#xff0c;并都将在 11 月 13 日…

关于el-table+el-input+el-propover的封装

一、先放图片便于理解 需求&#xff1a; 1、el-input触发focus事件&#xff0c;弹出el-table(当然也可以为其添加搜索功能、分页) 2、el-table中的复选共能转化成单选共能 3、选择或取消的数据在el-input中动态显示 4、勾选数据后&#xff0c;因为分页过多&#xff0c;原先选好…

【Linux网络】系统调优之聚合链路bonding,可以实现高可用和负载均衡

一、什么是多网卡绑定 二、聚合链路的工作模式 三、实操创建bonding设备&#xff08;mode1&#xff09; 1、实验 2、配置文件解读 3、查看bonding状态,验证bonding的高可用效果 三、nmcli实现bonding 一、什么是多网卡绑定 将多块网卡绑定同一IP地址对外提供服务&#xf…

多线程—锁

多线程中&#xff0c;锁用于确保同一时间只有一个线程可以访问共享资源&#xff0c;从而避免并发访问导致的数据不一致或者竞争条件等问题。 常见的锁有两种&#xff1a;互斥锁和读写锁。互斥锁的作用是保护共享资源&#xff0c;同时只允许一个线程访问&#xff0c;其他线程需…

aws亚马逊:什么是 Amazon EC2?

Amazon Elastic Compute Cloud&#xff08;Amazon EC2&#xff09;在 Amazon Web Services&#xff08;AWS&#xff09;云中按需提供可扩展的计算容量。使用 Amazon EC2 可以降低硬件成本&#xff0c;因此您可以更快地开发和部署应用程序。您可以使用 Amazon EC2 启动所需数量的…

Lua更多语法与使用

文章目录 目的错误处理元表和元方法垃圾回收协程模块面向对象总结 目的 在前一篇文章&#xff1a; 《Lua入门使用与基础语法》 中介绍了一些基础的内容。这里将继续介绍Lua一些更多的内容。 同样的本文参考自官方手册&#xff1a; https://www.lua.org/manual/ 错误处理 下…

ip数据包格式

位偏移0–34–78–1314-1516–1819–310版本首部长度区分服务显式拥塞通告全长32标识符标志分片偏移64存活时间协议首部检验和96源IP地址128目的IP地址160选项&#xff08;如首部长度>5&#xff09;160 或 192 数据 数据 协议字段值协议名缩写1互联网控制消息协议ICMP2…

原型模式(创建型)

一、前言 原型模式是一种创建型设计模式&#xff0c;它允许在运行时通过克隆现有对象来创建新对象&#xff0c;而不是通过常规的构造函数创建。在原型模式中&#xff0c;一个原型对象可以克隆自身来创建新的对象&#xff0c;这个过程可以通过深度克隆或浅克隆来实现。简单说原型…

【开源】基于Vue.js的生活废品回收系统的设计和实现

目录 一、摘要1.1 项目介绍1.2 项目详细录屏 二、研究内容三、界面展示3.1 登录注册3.2 资源类型&资源品类模块3.3 回收机构模块3.4 资源求购/出售/交易单模块3.5 客服咨询模块 四、免责说明 一、摘要 1.1 项目介绍 生活废品回收系统是可持续发展的解决方案&#xff0c;旨…

云效流水线docker部署 :node.js镜像部署VUE项目

文章目录 引言I 流水线配置1.1 项目dockerfile1.2 Node.js 镜像构建1.3 docker 部署引言 云效流水线配置实现docker 部署微服务项目:https://blog.csdn.net/z929118967/article/details/133687120?spm=1001.2014.3001.5501 配置dockerfile-> 镜像构建->docker部署。 …

【从0到1设计一个网关】性能优化---缓存

文章目录 为什么要用缓存?Caffeine Cache使用Caffeine效果演示为什么要用缓存? 首先先了解一下为什么在网关中我们需要用到缓存。 我们可以从如下几点来入手这个问题: 处理大规模流量: 网关是系统的入口,需要处理大规模的请求流量。高性能的网关能够快速而有效地处理大量…

【探索Linux】—— 强大的命令行工具 P.14(进程间通信 | 匿名管道 | |进程池 | pipe() 函数 | mkfifo() 函数)

阅读导航 引言一、进程间通信概念二、进程间通信目的三、进程间通信分类四、管道1. 什么是管道2. 匿名管道&#xff08;1&#xff09;创建和关闭⭕pipe() 函数⭕创建匿名管道⭕关闭匿名管道 &#xff08;2&#xff09;通信方式&#xff08;3&#xff09;用法示例&#xff08;4&…

oracle 中 %TYPE %ROWTYPE

前言 PL/SQL 提供了 %TYPE 和 %ROWTYPE 两种特殊的变量&#xff0c;用于声明与表的列相匹配的变量和用户定义数据类型&#xff0c;前一个表示单属性的数据类型&#xff0c;后一个表示整个属性列表的结构&#xff0c;即元组的类型。 举例&#xff1a; -- 数据表TB_TRANS_RECO…

Python命令行

在Python中&#xff0c;有时为了快速测试少量代码&#xff0c;最快最方便的方式是不写入文件。这是因为Python本身可以作为命令行运行。 在Windows、Mac或Linux命令行中输入以下内容&#xff1a; C:\Users\Your Name>python 或者&#xff0c;如果"python"命令不…

NLP领域的突破催生大模型范式的形成与发展

当前的大模型领域的发展&#xff0c;只是范式转变的开始&#xff0c;基础大模型才刚刚开始改变人工智能系统在世界上的构建和部署方式。 1、大模型范式 1.1 传统思路&#xff08;2019年以前&#xff09; NLP领域历来专注于为具有挑战性的语言任务定义和设计系统&#xff0c…

Leetcode刷题详解—— 目标和

1. 题目链接&#xff1a;494. 目标和 2. 题目描述&#xff1a; 给你一个非负整数数组 nums 和一个整数 target 。 向数组中的每个整数前添加 或 - &#xff0c;然后串联起所有整数&#xff0c;可以构造一个 表达式 &#xff1a; 例如&#xff0c;nums [2, 1] &#xff0c;可…