JVM Tuning Summary (GO)

Source: Internet
Author: User

This article transferred from: http://my.oschina.net/xishuixixia/blog/132395

Tuning parameters that are commonly used.

1. Heap Size

-XMS and-xmx are used to specify the heap size, and we need to set them to the same value to avoid resizing the heap after the GC.

2. Young Generation Size

-xx:newsize= and –xx:maxnewsize=? The young generation size is recommended to be set to a heap size of 1/3 or 1/4, and two values are the same size. Setting the size of the younger generation is quite important, and if the younger generation is set to small, then some objects that can have short life cycles may be moved to older generations, leading to full GC, and setting too large will also cause stop the world.

3. Method Area Size

-xx:permsize=256m and-xx:maxpermsize=256m, the method area size does not affect performance, as long as you set the value to ensure that the application does not report an error such as Oom.

4.GC Log

-XLOGGC: $CATALINA _base/logs/gc.log,-xx:+printgcdetails,-xx:+printgcdatestamps, record as many GC logs as possible, so that you can analyze the system behavior in a comprehensive way.

5.GC algorithm

-XX:+USEPARNEWGC,-xx:+cmsparallelremarkenabled,-XX:+USECONCMARKSWEEPGC,-xx:cmsinitiatingoccupancyfraction= 75, this is just the usual parameters in the general system, you also need to choose the most suitable system according to your system situation.

6. Heap Snapshots

-xx:+heapdumponoutofmemoryerror and-xx:heapdumppath= $CATALINA _base/logs.

7.OOM operations after the occurrence

After oom shutdown server:-xx:onoutofmemoryerror= $CATALINA _home/bin/stop.sh

Restart server after Oom:-xx:onoutofmemoryerror= $CATALINA _home/bin/restart.sh

JVM Tuning Summary (GO)

Related Article

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.