Tuning IBM JVM Heap

Source: Internet
Author: User
Setting The heap size for most configurations

This section contains guidelines to determining the appropriate Java heap size for most configurations. For most production applications, the IBM JVM Java heap size defaults are too small and must to be increased. In addition, if The–xgcpolicy:gencon option are used, the nursery size must be increased.

There are several approaches to setting optimal; We outline one useful approach here. Set the initial heap size (-xms option) to a reasonable value (for example, 256 MB), and the maximum heap size (-XMX) Opti On to something reasonable, but large (for example, 1024 MB). The maximum heap size must never force the heap to page. It is imperative this heap always stays in physical memory. The JVM then tries to keep the GC time within reasonable limits by growing and shrinking the heap. The output from VERBOSEGC must then is used to monitor GC activity.

The

If generational Concurrent GC is used (-xgcpolicy:gencon), the new area size can also as set to specific values. By default, the new size is a quarter of the total heap size or MB, whichever is smaller. To improve performance, the nursery size must is a quarter of the heap size or larger, and it must not is capped at 64MB. New area sizes are set by JVM options:-xmn <size>,-xmns<initialsize>, And-xmnx<maxsize>.

After the initial heap sizes are set, VERBOSEGC traces must then is used to monitor GC activity. After analyzing the output, modify the heap settings accordingly. For example, if the percentage of the the ' in GC ' is high and ' heap has grown to it maximum size, throughput can be improve D by increasing the maximum heap size. As a rule of thumb, greater than 10% of the total time spent in GC are generally considered high. Note:increasing the maximum size of the Java heap can not always solve this type of problem as it are could be memory ov Er-usage problem. Conversely, if response times are too long due to GC pause times, decrease the heap size. If both problems are observed, an analysis of the application heap usage is required.

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.