JVM parameter implications

Source: Internet
Author: User
JAVA-XMS2G-XMX2G-XMN512M-XSS128K-XX:PERMSIZE=128M-XX:MAXPERMSIZE=128M-XX:NEWRATIO=4-XX:SURIVORRATIO=4-XX: Maxtenuringthreshold=1
-XMS2G:JVM Boot initialization heap size is 2G,XMS by default is 1/64 of physical memory but less than 1G.
-XMX2G:JVM the largest heap size is 2G,XMX, which defaults to 1/4 of physical memory, but less than 1G, and the-XMS and-XMX values are configured so that the JVM heap size can be adjusted again after each garbage collection completes.
-XMN512M: The Cenozoic size in the heap is 512M
-xss128k: The stack size for each thread is 128K
The initialization size of the-XX:PERMSIZE=128M:JVM persistence generation is 128M
The maximum size of the-XX:MAXPERMSIZE=128M:JVM persistence generation is 128M
The-XX:NEWRATIO=4:JVM heap of the Cenozoic and the old age ratio of 1:4
-xx:survivorratio=4: The ratio of the Cenozoic Surivor region (2 Surivor regions) and Eden area is 2:4
-xx:maxtenuringthreshold=1: The new generation of objects after several garbage collection (if still survive), into the old age. If this parameter is set to 0, this means that the new generation of objects, after garbage collection, do not enter the survivor area, directly into the old age


java-xx:+useparallelgc-xx:parallelgcthread=4-xx:+useparalleloldgc-xx:maxgcpausemillis=100-xx:+ Useadaptivesizepolicy
-XX:+USEPARALLELGC: Use parallel garbage collector, but only for the new generation of effective, the old age still use serial collector
-xx:parallelgcthread=4: The thread to set up the parallel garbage collector is 4, preferably the same as the number of processors
-XX:+USEPARALLEOLDGC: Configure old age using parallel garbage collector, JDK1.6 supports old age using parallel collectors
-XX:MAXGCPAUSEMILLIS=100: Sets the maximum amount of time per collector garbage collection per generation, and if that time is not met, the JVM automatically adjusts the size of the Cenozoic region to meet the value
-xx:+useadaptivesizepolicy: When this value is set, the JVM automatically adjusts the generation size and the corresponding Surivor area to reach the minimum response time set or collection frequency.


Java-xx:useconcmarksweepgc-xx:+useparnewgc-xx:cmsfullgcsbeforecompaction=5-xx:+usecmscompactatfullcollection
-XX:USECONCMARKSWEEPGC: Set the old age of the JVM heap using the CMS concurrency Collector, the-xx:newratio parameter fails after the parameter is set, but the-XMN parameter is still valid
-XX:USEPARNEWGC: Set up a new generation to use concurrent collectors, in JDK1.5 above, the JVM will be automatically set according to the system
-xx:cmsfullgcsbeforecompaction=5: Set 5 before CMSGC the heap space for compression, finishing
-xx:+usecmscompactatfullcollection: Turn on compression of old age, may affect performance, but can eliminate heap fragmentation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.