JVM Memory Management: Garbage collector parameter Fine solution

Source: Internet
Author: User
Tags garbage collection

This is the last GC-related article, the LZ is just a list of key parameters related to the garbage collector in the Hotspot JVM, as well as explanations of each parameter. Don't say much nonsense, this begins.

Garbage collector selection Parameters

USESERIALGC: Open this parameter using the serial & serial old collector (client mode defaults).

USEPARNEWGC: Open this parameter using the Parnew & serial old collector (not recommended).

USECONCMARKSWEEPGC: Open this parameter to use Parnew & CMS (serial old as a substitute) collector.

USEPARALLELGC: Open this parameter to use the parallel scavenge & parallel old collector (server mode defaults).

USEPARALLELOLDGC: Open this parameter to use the parallel old collector in the older generation (this parameter is useless after JDK1.5).

JVM individual memory area size related parameters

Xms: The initial value of the heap. The default is 1/64 of the physical memory, and the maximum does not exceed 1G.

XMX: The maximum value of the heap. The default is 1/4 of the physical memory, and the maximum does not exceed 1G.

XMN: The size of the Cenozoic.

XSS: Thread stack size.

PermSize: Permanent generation initial size. The default is 1/64 of the physical memory, and the maximum does not exceed 1G.

MaxPermSize: Maximum value for permanent generation. The default is 1/4 of the physical memory, and the maximum does not exceed 1G.

Newratio: The ratio of the Cenozoic to the older generation. For example, 3, then the Cenozoic Jian 1/4, older generation accounted for 3/4.

Survivorratio: The ratio of the new generation to adjust the Eden area and the Survivor area, the default is 8, that is, the Eden area is 80% size, two survivor respectively 10% of the size. (Note: This parameter setting is to explain the replication algorithm in the chapter, solve the replication algorithm memory by half.) The Eden area is the 80% part of the copy algorithm chapter, and the Survivor area is the two 10% part. )

Garbage collector Performance General parameters

Pretenuresizethreshold: The size of an object promoted to an older generation. The default is 0, for example, 10M, then more than 10M objects will not be allocated in the Eden area, but directly into the old generation.

Maxtenuringthreshold: The maximum age for promotion in the old years. The default is 15, for example, set to 10, then the object will be placed in the old generation after 10 ordinary GC.


Parallel collector parameters

Parallelgcthreads: The number of threads that were opened at the time of collection. The default is equal to the number of CPUs.

Gctimeratio: Sets the system throughput. For example, set to 99, the GC time ratio is 1/1+99=1%, that is, the requirement throughput is 99%. If not satisfied, it will shrink the Cenozoic size.

Maxgcpausemillis: Sets the maximum pause time for garbage collection. If the setting value is not met, the new generation size will be reduced preferentially, and the throughput will be sacrificed if it is still not satisfied.

Concurrent Collector Parameters

Cmsinitiatingoccupancyfraction: The percentage of memory that triggers the CMS collector. For example, 60% means that when the memory reaches 60%, the CMS will start to collect concurrently.

Usecmscompactatfullcollection: This has been mentioned earlier to send a memory collation after every CMS collector cleans up the garbage.

Cmsfullgcsbeforecompaction: Set up after several CMS garbage collection, triggering a memory collation.


GC-related series is basically over, this article is just a list, then we together to enter the virtual machine source World bar.

Author: zuoxiaolong (Zao Jianrong)

Source: Blog Park Zao Jianrong Technology Blog--http://www.cnblogs.com/zuoxiaolong

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.