Created: 27 Nov 2006
Java applications can occasionally suffer from performance problems due to garbage collection. In the past I’ve addressed these by choosing a different garbage collector and tweaking the sizes of the generational areas within the heap.
While investigating garbage collection pauses on Friday, I read the garbage collection tuning guide for the 1.5 JVM. Sun introduced a new feature, called ergonomics, which allows you to specify garbage collection goals. Very handy as this is exactly the control over garbage collection that a sys admin needs.
In my case, -XX:MaxGCPauseMillis=500
told the JVM that the target
was a maximum collection pause time of 0.5s. This should prevent large
pauses giving some users a very poor response time. In my case it
stopped requests timing out and also improved the mean response time
by 30-40%.
This feature is only available in the throughput collector, which is the default collector for the server jvm.
If your application performance is important and you haven’t yet benchmarked your application with ergonomics, I’d strongly suggest trying it. Reading the garbage collection tuning guide for the 1.5 jvm would also be a valuable use of your time.
Great feature, terrible name. Goal-based garbage collection would have been my choice.