当前位置:网站首页>JVM - common parameters
JVM - common parameters
2022-04-23 10:31:00 【Xiaoxian.】
One 、 Parameter query
perform :
java -XX:+PrintFlagsFinal
Be careful :
= Represents the default value
:= Said by JVM Or the value modified by the user
Two 、 Parameter classification
1、 Standard parameters
-version
-help
-server
-cp
2、-X Parameters ( Nonstandard ,JDK There may be changes in various versions )
-Xint Explain to perform
-Xcomp Compile it into local code for the first time
-Xmixed Mixed mode ,JVM Decide for yourself
3、-XX Parameters ( Nonstandard , Relatively unstable , It is mainly used for JVM tuning )
1)Boolean type
Format :
-XX:[+-]<name>
Be careful :
+ Means to enable name attribute
- Disable name attribute
Example :
-XX:+UseConcMarkSweepGC Means to enable CMS Type of garbage collector
-XX:+UseG1GC Means to enable G1 Type of garbage collector
2) Not Boolean type
Format :
-XX<name>=<value>
Be careful :
name The value of the property is value
Example :
-XX:MaxGCPauseMillis=500
4、 The other parameters ( Short for parameters )
-Xms1000M Equivalent to -XX:InitialHeapSize=1000M
-Xmx1000M Equivalent to -XX:MaxHeapSize=1000M
-Xss100 Equivalent to -XX:ThreadStackSize=100
3、 ... and 、 Common parameters
Parameters | meaning | explain |
---|---|---|
-XX:CICompilerCount=3 | Maximum number of parallel compilations | If the setting is greater than 1, Although the compilation speed will increase , But it also affects the stability of the system , Will increase JVM Possibility of collapse |
-XX:InitialHeapSize=100M | Initialize heap size | Abbreviation -Xms100M |
-XX:MaxHeapSize=100M | Maximum heap size | Abbreviation -Xms100M |
-XX:NewSize=20M | Set the size of the younger generation | |
-XX:MaxNewSize=50M | The largest size of the younger generation | |
-XX:OldSize=50M | Set the age size | |
-XX:MetaspaceSize=50M | Set method area size | |
-XX:MaxMetaspaceSize=50M | Maximum size of method area | |
-XX:+UseParallelGC | Use UseParallelGC | The new generation , Throughput priority |
-XX:+UseParallelOldGC | Use UseParallelOldGC | Old age , Throughput priority |
-XX:+UseConcMarkSweepGC | Use CMS | Old age , Pause time first |
-XX:+UseG1GC | Use G1GC | The new generation , Old age , Pause time first |
-XX:NewRatio | The ratio of the new generation to the old generation | such as -XX:Ratio=4, It means Cenozoic : Old age =1:4, That is, the Cenozoic accounts for the whole heap memory 1/5 |
-XX:SurvivorRatio | Two S Area and Eden Area ratio | such as -XX:SurvivorRatio=8, That is to say (S0+S1):Eden=2:8, That's one S Of the whole Cenozoic 1/10 |
-XX:+HeapDumpOnOutOfMemoryError | Start heap memory overflow printing | When JVM When heap memory overflows , That is to say OOM, Automatic generation dump file |
-XX:HeapDumpPath=heap.hprof | Specifies the heap memory overflow print directory | Indicates that a... Is generated in the current directory heap.hprof file |
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:g1-gc.log |
Print out GC journal | Different garbage collectors can be used , Contrast check GC situation |
-Xss128k | Set the stack size for each thread | The empirical value is 3000-5000 The best |
-XX:MaxTenuringThreshold=6 | Increase the maximum critical value of the elderly | The default value is 15 |
-XX:InitiatingHeapOccupancyPercent | Start concurrency GC The proportion of heap memory used during the cycle | G1 Garbage collectors like that use it to trigger concurrency GC cycle , Based on the utilization of the whole heap , It's not just a generation of memory usage ratio . The value is 0 said ” Has been performed GC loop ”. The default value is 45 |
-XX:G1HeapWastePercent | Percentage of allowed wasted heap space | The default is 10%, If the recyclable space of concurrent tags is less than 10%, It doesn't trigger MixedGC. |
-XX:MaxGCPauseMillis=200ms | G1 Maximum pause time | The pause time cannot be too small , Too small will lead to G1 Can't keep up with the speed of garbage . Eventually degenerated into FullGC. So tuning this parameter is a continuous process , Gradually adjust to the best . |
-XX:ConcGCThreads=n | The number of threads used by the concurrent garbage collector | The default value follows JVM Running on different platforms |
-XX:G1MixedGCLiveThresholdPercent=65 | Old areas to be included in the mixed waste recycling cycle | Set the occupancy threshold for the domain. The default occupancy is 65% |
-XX:G1MixedGCCountTarget=8 | After setting the marking cycle , The upper limit for survival data is G1MixedGCLIveThresholdPercent The target number of times to perform mixed garbage collection in the old area of | Default 8 Secondary mixed waste recycling , The goal of mixed recycling is to control within this target number |
-XX:G1OldCSetRegionThresholdPercent=1 | describe Mixed GC when ,OldRegion Be added to CSet in | By default ,G1 Only 10% Of OldRegion Add to CSet in |
Four 、 Common ways to set parameters
1、 development tool :IDEA,eclipse
2、 function jar:java -XX:+UseG1GC xxx.jar
3、Web Containers :tomcat Script
4、 adopt jinfo Adjust something in real time java Process parameters ( The parameter is only marked manageable Of flags Can be modified in real time )
版权声明
本文为[Xiaoxian.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231005321440.html
边栏推荐
猜你喜欢
Jerry's more accurate determination of abnormal address [chapter]
部署jar包
Net start MySQL MySQL service is starting MySQL service failed to start. The service did not report any errors.
精彩回顾 | DEEPNOVA x Iceberg Meetup Online《基于Iceberg打造实时数据湖》
Juc并发编程09——Condition实现源码分析
解决方案架构师的小锦囊 - 架构图的 5 种类型
SQL Server cursor circular table data
SQL Server 游标循环表数据
中职网络安全2022国赛之CVE-2019-0708漏洞利用
Sim Api User Guide(4)
随机推荐
203、移出链表元素(链表)
MapReduce compression
Wonderful review | deepnova x iceberg meetup online "building a real-time data Lake based on iceberg"
Juc并发编程07——公平锁真的公平吗(源码剖析)
Sim Api User Guide(8)
Sim Api User Guide(7)
454、四数之和(哈希表)
Sim Api User Guide(4)
Example of pop-up task progress bar function based on pyqt5
242、有效字母异位词(哈希表)
C语言——自定义类型
203. Remove linked list elements (linked list)
Shell script interaction free
SQL tuning series - Introduction to SQL tuning
JVM——》常用命令
图像处理——噪声小记
解决VMware卸载后再安装出现的问题
24. Exchange the nodes in the linked list (linked list)
What about Jerry's stack overflow? [chapter]
Download and installation steps of xshell + xftp