当前位置:网站首页>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 .

边栏推荐
- Add salt and pepper noise or Gaussian noise to the picture
- 高级程序员必知必会,一文详解MySQL主从同步原理,推荐收藏
- Classic questions about data storage
- 判断文件是否为DICOM文件
- EMMC print cqhci: timeout for tag 10 prompt analysis and solution
- Introduction to the extension implementation of SAP Spartacus checkout process
- Hcip seventh operation
- Red Hat安装内核头文件
- MFC BMP sets the resolution of bitmap, DPI is 600 points, and gdiplus generates labels
- The solution of a simple algebraic problem
猜你喜欢

产业金融3.0:“疏通血管”的金融科技

Nvisual network visualization

Digital IC interview summary (interview experience sharing of large manufacturers)

CTFshow--常用姿势

If you don't know these four caching modes, dare you say you understand caching?

Reptile exercises (III)

职场经历反馈给初入职场的程序员
![[云原生]微服务架构是什么?](/img/84/a0ec68646083f3539aa39ad9d98749.png)
[云原生]微服务架构是什么?

cf:C. Column Swapping【排序 + 模拟】

数字IC面试总结(大厂面试经验分享)
随机推荐
【日常训练--腾讯精选50】235. 二叉搜索树的最近公共祖先
Hcip seventh operation
【已解决】记一次EasyExcel的报错【读取xls文件时全表读不报错,指定sheet名读取报错】
Sidecar mode
Reading notes of Clickhouse principle analysis and Application Practice (6)
《ClickHouse原理解析与应用实践》读书笔记(6)
VScode进行代码补全
Get the way to optimize the one-stop worktable of customer service
Message queue: how to deal with message backlog?
Bbox regression loss function in target detection -l2, smooth L1, IOU, giou, Diou, ciou, focal eiou, alpha IOU, Siou
zabbix_ Get test database failed
Industrial Finance 3.0: financial technology of "dredging blood vessels"
SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server
mac版php装xdebug环境(m1版)
What are the common message queues?
Win configuration PM2 boot auto start node project
JVM命令之 jstat:查看JVM统计信息
Why does the data center need a set of infrastructure visual management system
Classic questions about data storage
Go语学习笔记 - gorm使用 - gorm处理错误 | Web框架Gin(十)