Improving response times and CPU utilization
To improve overall throughput, consider implementing a generational garbage collection strategy, which is also known as a “generational concurrent garbage collection”
- Reduce or eliminate garbage collection pauses
- Trade some memory throughput to accomplish the reduction or elimination
Applications with these kinds of workloads often use gigabyte-sized heaps. Following are some characteristics of workloads that could benefit from generational garbage collection:
- Allocates many short-lived objects
- Are transaction-based, where objects in the transaction are deleted after the transaction is committed
- Tend to develop a fragmented heap
Following are the JVM switches that define a specific garbage collector algorithm. Consider setting the garbage collector algorithm to “gencon”, a generational, concurrent garbage collector. With this type of garbage collector, objects are allocated in the young generation (the nursery). When the young generation is full, JVM stops all Java™ threads and moves the live objects in the young generation to the old generation.
- WebSphere® format: -Xgcpolicy:gcType, Example: -Xgcpolicy:gencon
- Oracle JRockit format: -Xgc:gcType, Example: -Xgc:gencon
- Java HotSpot: Generational garbage collection is the default setting.