![]() ![]() ![]() ![]() ![]() ![]() |
The following sections describe how to tune Java Virtual Machine (JVM) garbage collection performance for engine tier servers:
Production installations of WebLogic SIP Server generally require extremely small response times (under 50 milliseconds) for clients at all times, even under peak server loads. A key factor in maintaining brief response times is the proper selection and tuning of the JVM's Garbage Collection (GC) algorithm for WebLogic SIP Server instances in the engine tier.
Whereas certain tuning strategies are designed to yield the lowest average garbage collection times or to minimize the frequency of full GCs, those strategies can sometimes result in one or more very long periods of garbage collection (often several seconds long) that are offset by shorter GC intervals. With a production SIP Server installation, all long GC intervals must be avoided in order to maintain response time goals.
The sections that follow describe GC tuning strategies for JRockit and Sun's JVM that generally result in best response time performance.
When using BEA's JRockit JVM, the best response time performance is generally obtained by using the single-spaced, concurrent garbage collector with a very small (1%) compaction rate. These settings can be obtained with the following startup options:
It is important to use the low compaction ratio setting along with the single-spaced GC algorithm to obtain the best response time performance. Note, however, that using the indicated compaction ratio may be problematic if you deploy applications that periodically allocate drastically different sizes of memory in the heap (for example a 10K allocation followed by byte-sized increments).
WARNING: | If you deploy applications that allocate varying sizes of memory, using a small compaction ratio may lead to Out Of Memory errors or forced compaction, both of which must be avoided in a production system. You must thoroughly analyze deployed applications in a stage environment to determine which JVM settings are acceptable for your system. |
JRockit provides several monitoring tools that you can use to analyze the JVM heap at any given moment, including:
Use these and other tools in a controlled environment to determine the effects of JVM settings before you use the settings in a production deployment. See the BEA WebLogic JRockit 1.4.2 SDK Documentation for more information about JRockit and JRockit profiling tools.
When using Sun's JDK, the goal in tuning garbage collection performance is to reduce the time required to perform a full garbage collection cycle. You should not attempt to tune the JVM to minimize the frequency of full garbage collections, because this generally results in an eventual forced garbage collection cycle that may take up to several full seconds to complete.
The simplest and most reliable way to achieve short garbage collection times over the lifetime of a production server is to use a fixed heap size with the default collector and the parallel young generation collector, restricting the new generation size to at most one third of the overall heap. The following example JVM settings highlights the key garbage collection options used in this strategy:
-XX:+UseTLAB -XX:+UseParNewGC -Xms768m -Xmx768m -XX:NewSize=256m -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=128
The above options have the following effect:
-XX:+UseTLAB
—Uses thread-local object allocation blocks. This improves concurrency by reducing contention on the shared heap lock.-XX:+UseParNewGC
—Uses a parallel version of the young generation copying collector alongside the default collector. This minimizes pauses by using all available CPUs in parallel. The collector is compatible with both the default collector and the Concurrent Mark and Sweep (CMS) collector.-Xms768m, -Xmx768m
—Fixes the heap size to increase the predictability of garbage collection. -Xmx768m
limits the heap size so that even Full GCs do not trigger SIP retransmissions. -Xms
sets the starting size to match to prevent pauses caused by heap expansion.-XX:NewSize=256m
—Defines the minimum young generation size. BEA recommends testing your production applications starting with a young generation size of 1/3 the total heap size. Using a larger young generation size causes fewer minor collections to occur but may compromise response time goals by cause longer-running full collections.You can fine-tune the frequency of minor collections by gradually reducing the size of the heap allocated to the young generation to a point below which the observed response time becomes unacceptable.
-XX:MaxTenuringThreshold=0
—Makes the full NewSize available to every NewGC cycle, and reduces the pause time by not evaluating tenured objects. Technically, this setting promotes all live objects to the older generation, rather than copying them.-XX:SurvivorRatio=128
—Specifies a high survivor ratio, which goes along with the zero tenuring threshold to ensure that little space is reserved for absent survivors.
![]() ![]() ![]() |