当前位置:网站首页>Jinfo of JVM command: view and modify JVM configuration parameters in real time
Jinfo of JVM command: view and modify JVM configuration parameters in real time
2022-07-07 06:00:00 【Zhang Junjie 1994】
Study Silicon Valley Song Hongkang JVM From entry to mastery Learning notes of
summary
jinfo All in all Configuration Info for Java
The function is to view the virtual machine configuration parameter information , It can also be used to adjust the configuration parameters of virtual machines .
In many cases ,Java The application does not specify all Java Virtual machine parameters , After all, there are too many virtual machine parameters , Developers may not know something Java What is the default value of virtual machine parameter settings , For example, I would like to see the default ratio of the new generation to the old generation . At this time, if developers look for development documents , It may be more troublesome , But use jinfo Tools , Developers can quickly view the parameters of a virtual machine configuration .

Basic grammar

see
jinfo -sysprops process id
Can view by System.getProperties() Parameters obtained
jinfo -flags process id
Look at some parameters that have been assigned values
jinfo -flag Parameter name process id
View a certain java Process specific parameter information
modify 

in the light of boolean type
jinfo -flag [+|-] Parameter name process id
For non boolean type
jinfo -flag Parameter name = Parameter values process id
demonstration


After setting, start the above main Method . Now use the command to check .
use jps -v You can see the parameters we set ourselves , But if we want to know how many parameters we haven't set , We use jps -v Not very good .
Use jinfo -sysprops 2540 You can check some information .
Query the information assigned value 
Check the specific assigned information , Query whether to use parallel garbage collector . “+” Representative used 
Query whether a serial garbage collector is used , “- ” The representative did not use 
Check the maximum heap space 
Modifying parameters can take effect immediately , But not all values can be dynamically modified , Only those marked as manageable Of flag It can be modified in real time ,
The following command is to view PrintGCDetails Value , The result is “-” The representative has not modified 
The first line of command PrintGCDetails Add “+” , Then execute the command in the second line , see , I found out that it was "-“, Now it's ”+", Description parameters have been modified .
The following is also dynamic modification , Check... After modification , It was found that the modification was successful .

Be careful , Dynamically modified values are only temporarily valid , When you shut down this process , This dynamically modified parameter is invalid , Next time you start Java When it comes to programming , Back to the original value .
Expand
expand
java -XX:+PrintFlagsInitial
View all JVM Initial value of parameter start
java -XX:+PrintFlagsFinal
View all JVM The final value of the parameter 
Add a colon before the value : Is the modified value , What is not added is the initial value that has not changed
java - Parameter name :+PrintCommandLineFlags
Look at those that have been used by users or JVM Set up detailed XX The name and value of the parameter
demonstration

Output the result to 1.txt Inside .

边栏推荐
- Hcip seventh operation
- PTA TIANTI game exercise set l2-003 moon cake test point 2, test point 3 Analysis
- Cf:c. column swapping [sort + simulate]
- Message queuing: how to ensure that messages are not lost
- What are the common message queues?
- C. colonne Swapping [tri + Simulation]
- ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用shap决策图结合LightGBM模型实现异常值检测案例之详细攻略
- What EDA companies are there in China?
- Message queue: how to handle repeated messages?
- Modes of optical fiber - single mode and multimode
猜你喜欢

一名普通学生的大一总结【不知我等是愚是狂,唯知一路向前奔驰】

Detailed explanation of platform device driver architecture in driver development

EMMC打印cqhci: timeout for tag 10提示分析与解决

I didn't know it until I graduated -- the principle of HowNet duplication check and examples of weight reduction

Message queue: how to deal with message backlog?

Reptile exercises (III)

yarn入门(一篇就够了)

JVM命令之 jstat:查看JVM统计信息
![[daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree](/img/4c/16bb943e517c7b703996715632e6ca.png)
[daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree

【FPGA教程案例14】基于vivado核的FIR滤波器设计与实现
随机推荐
Realize GDB remote debugging function between different network segments
PowerPivot - DAX (function)
Understand the deserialization principle of fastjson for generics
Mysql-centos7 install MySQL through yum
Get the way to optimize the one-stop worktable of customer service
Harmonyos practice - Introduction to development, analysis of atomized services
[云原生]微服务架构是什么?
C. colonne Swapping [tri + Simulation]
《ClickHouse原理解析与应用实践》读书笔记(6)
Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting
Check Point:企业部署零信任网络(ZTNA)的核心要素
CMD permanently delete specified folders and files
三级菜单数据实现,实现嵌套三级菜单数据
Type de texte de commutation d'entrée et de mot de passe de l'applet natif
R language [logic control] [mathematical operation]
SAP ABAP BDC (batch data communication) -018
ML's shap: Based on the adult census income binary prediction data set (whether the predicted annual income exceeds 50K), use the shap decision diagram combined with the lightgbm model to realize the
Win configuration PM2 boot auto start node project
Ten stages of becoming a Senior IC Design Engineer. What stage are you in now?
牙齿干细胞的存储问题(未完待续)