当前位置:网站首页>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 .
边栏推荐
- mac版php装xdebug环境(m1版)
- 980. 不同路径 III DFS
- [cloud native] what is the microservice architecture?
- Hcip eighth operation
- @pathvariable 和 @Requestparam的详细区别
- Message queuing: how to ensure that messages are not lost
- SAP ABAP BDC (batch data communication) -018
- Message queue: how to handle repeated messages?
- 绕过open_basedir
- CTFshow--常用姿势
猜你喜欢
上海字节面试问题及薪资福利
Introduction to yarn (one article is enough)
Web authentication API compatible version information
【SQL实战】一条SQL统计全国各地疫情分布情况
Realize GDB remote debugging function between different network segments
Red Hat安装内核头文件
OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力
R language [logic control] [mathematical operation]
如果不知道这4种缓存模式,敢说懂缓存吗?
Go语学习笔记 - gorm使用 - 原生sql、命名参数、Rows、ToSQL | Web框架Gin(九)
随机推荐
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用shap决策图结合LightGBM模型实现异常值检测案例之详细攻略
PTA 天梯赛练习题集 L2-002 链表去重
Three level menu data implementation, nested three-level menu data
Nvisual network visualization
Hcip seventh operation
On the difference between FPGA and ASIC
nVisual网络可视化
[云原生]微服务架构是什么?
Input of native applet switches between text and password types
Data storage 3
Flask 1.1.4 werkzeug1.0.1 analyse du code source: processus de démarrage
【SQL实战】一条SQL统计全国各地疫情分布情况
Go 語言的 Context 詳解
Opensergo is about to release v1alpha1, which will enrich the service governance capabilities of the full link heterogeneous architecture
What are the common message queues?
[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]
原生小程序 之 input切換 text與password類型
Message queue: how to handle repeated messages?
Forkjoin is the most comprehensive and detailed explanation (from principle design to use diagram)
CMD permanently delete specified folders and files