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

边栏推荐
- Reptile exercises (III)
- zabbix_get测试数据库失败
- MySQL performance_ Schema common performance diagnosis query
- 980. Different path III DFS
- [daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
- Nvisual network visualization
- Message queue: how to deal with message backlog?
- Randomly generate session_ id
- Differences and introduction of cluster, distributed and microservice
- Introduction to distributed transactions
猜你喜欢

PTA 天梯赛练习题集 L2-004 搜索树判断

软件测试面试技巧

Pytorch builds neural network to predict temperature

TCC of distributed transaction solutions
![[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

苹果cms V10模板/MXone Pro自适应影视电影网站模板

Randomly generate session_ id
![R language [logic control] [mathematical operation]](/img/93/06a306561e3e7cb150d243541cc839.png)
R language [logic control] [mathematical operation]

Reptile exercises (III)

An example of multi module collaboration based on NCF
随机推荐
[solved] record an error in easyexcel [when reading the XLS file, no error will be reported when reading the whole table, and an error will be reported when reading the specified sheet name]
How much do you know about clothing ERP?
STM32 key state machine 2 - state simplification and long press function addition
[daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server
Input of native applet switches between text and password types
目标检测中的损失函数与正负样本分配:RetinaNet与Focal loss
Dynamic memory management
Personal imitation SSM framework
毕业之后才知道的——知网查重原理以及降重举例
Sidecar mode
EMMC打印cqhci: timeout for tag 10提示分析与解决
原生小程序 之 input切換 text與password類型
原生小程序 之 input切换 text与password类型
SQL Server 2008 各种DateTime的取值范围
Loss function and positive and negative sample allocation in target detection: retinanet and focal loss
Understand the deserialization principle of fastjson for generics
Go 语言的 Context 详解
Ten stages of becoming a Senior IC Design Engineer. What stage are you in now?
Nodejs get client IP