调整IBM jvm heap

Setting the heap size for most configurations

This section contains guidelines for 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 be increased. In addition, if the –Xgcpolicy:gencon option is used, the nursery size must be increased.

There are several approaches to setting optimal heap sizes; 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) option to something reasonable, but large (for example, 1024 MB). The maximum heap size must never force the heap to page. It is imperative that the 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 be used to monitor GC activity.

If Generational Concurrent GC is used (-Xgcpolicy:gencon), the new area size can also be set to specific values. By default, the new size is a quarter of the total heap size or 64 MB, whichever is smaller. To improve performance, the nursery size must be a quarter of the heap size or larger, and it must not be 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 be used to monitor GC activity. After analyzing the output, modify the heap settings accordingly. For example, if the percentage of time in GC is high and the heap has grown to its maximum size, throughput can be improved by increasing the maximum heap size. As a rule of thumb, greater than 10% of the total time spent in GC is generally considered high.

Note: Increasing the maximum size of the Java heap can not always solve this type of problem as it is could be a memory over-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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值