JVM Learning Series (five) common JVM arguments

parameter Explanation Examples
-Xms The initial heap size, the default physical memory 1/64 -Xms512M
-Xmx The maximum heap size, physical memory by default 1/4 -Xms2G
-Xmn The new generation of memory size, the official recommendation for the entire heap 3/8 -Xmn512M
-Xss Thread stack size, jdk1.5 after the default and 1M, before the default 256k -Xss512k
-XX:NewRatio=n Setting the ratio of the new generation and old generation. Such as: 3, showing the young generation to the old generation ratio of 1: 3, the total the young generation and the young generation older generations 1/4 -XX:NewRatio=3
-XX:SurvivorRatio=n Eden area ratio of the two regions Survivor younger generation. Note that there are two Survivor areas. Such as: 8, showing Eden: Survivor = 8: 1: 1, the total area Survivor a young generation 1/8 -XX:SurvivorRatio=8
-XX:PermSize=n Permanent substituting the initial value, a default physical memory 1/64 -XX:PermSize=128M
-XX:MaxPermSize=n Maximum permanent generation of default physical memory 1/4 -XX:MaxPermSize=256M
-verbose:class Loaded in the console print category
-verbose:gc Print garbage collection in the console log
-XX:+PrintGC Print GC logs, simple content
-XX:+PrintGCDetails Print GC logs, detailed
-XX:+PrintGCDateStamps GC log in to add a timestamp
-Xloggc:filename Gc log path specified -Xloggc:/data/jvm/gc.log
-XX:+UseSerialGC Set the young generation serial collector Serial
-XX:+UseParallelGC The young generation is set parallel collector Parallel Scavenge
-XX:ParallelGCThreads=n Set the number of CPU use when collecting Parallel Scavenge. Parallel to collect the number of threads. -XX:ParallelGCThreads=4
-XX:MaxGCPauseMillis=n Parallel Scavenge recovery set maximum time (ms) -XX: MaxGCPauseMillis = 100
-XX:GCTimeRatio=n Set Parallel Scavenge garbage collection time as a percentage of the program running time. Formula 1 / (1 + n) -XX:GCTimeRatio=19
-XX:+UseParallelOldGC Provided on behalf of the elderly collector parallel collector ParallelOld
-XX:+UseConcMarkSweepGC Setting years old concurrent collector CMS
-XX:+CMSIncrementalMode CMS collector is provided as the incremental mode, the case for a single CPU.

The garbage collector parameters related

parameter Explanation Examples
UseSerialGC Default Client running in the virtual machine mode, the switch is open, using Serial + Serial Old collector combination memory recall
UseParNewGC After opening the switch, using ParNew + Serial Old collector assembly collection
UseConcMarkSweepGC After opening the switch, using ParNew + CMS + collector assembly Serial Old garbage collected, as the collector Serial Old fails Concurrent Mode Failure to appear back CMS collector using the collector
UseParallelGC The default value of the virtual machine running in Server mode, open the stuck pipe, using the Parallel Scavenge + Serial Old garbage collector combination
UseParallelOldGC After opening the switch, using Parallel Scavenge + Parallel Old collector garbage collection performed in combination
SurvivorRatio Eden memory region and the proportion of the new generation area Survivor, the default is 8, representative of Eden: Survivor = 8: 1
PretenureSizeThrehold Directly promoted to the old object's size, after setting this parameter, this parameter is greater than the distribution of objects directly in the old years
MaxTenuringThreshold Promoted to old age target age, each object after minor gc, +1 age greater than this age when entering years old
UseAdaptiveSizePolicy 动态调整JAVA堆中各个区域的大小以及进入老年代的年龄
HandlePromotionFailure 是否允许分配担保失败,即老年代的剩余空间不足以应对新生代的整个Eden和Survivor区的所有对象都存活的极端情况
ParallelGCThreads 设置并发GC时进行内存回收的线程数
GCTimeRatio GC时间占总时间的比例,默认99,即允许1%的GC时间,仅在使用Parallel Scavenge收集器使用
MaxGCPauseMillis 设置GC最大的亭短时间,仅在使用Parallel Scavenge收集器时生效
CMSInitialtingOccupancyFraction 设置CMS收集器在老年代空间被多少使用后出发垃圾收集,默认是68%,仅在使用CMS收集器时生效
UseCMSCompactAtFullCollection 设置CMS收集器在垃圾收集完成后是否进行一次内存碎片整理,仅在使用CMS收集时生效
CMSFullGCsBeforeCompaction 设置CMS收集器在进行若干次垃圾回收时再启动一次内存碎片整理,仅在CMS收集器时生效

Guess you like

Origin www.cnblogs.com/jakaBlog/p/11767908.html