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.