Thanks John. It's very useful to hear from the experts.
A couple of other comments about garbage collection based on my experiences:
- gencon is the current default. Don't automatically change to
||||optthruput without measuring just because it sounds right for a
batch job. It depends on the allocation patterns, but for my batch jobs
(many short lived objects) the default gencon seems much better.
- Left to its own devices, Java will grow or shrink the heap based on GC
results to try to maximize performance. I would hope that in most cases
this is better than manually controlling the size, although I haven't
tried to measure it.
- One thing that is unclear in much of the documentation is what some of
the strategies are trying to optimize. The strategies targeted at
response time sensitive applications are clear - they are trying to
minimize GC pause time. Strategies like optthruput are not so clear -
optimize throughput vs. what? The documentation sounds like maximum work
in minimum elapsed time but many people would want to minimize CPU time,
at the expense of elapsed time if necessary.
Andrew Rowley
Black Hill Software
On 08/08/2015 08:03 PM, John Eells wrote:
Marcel Mitran, an IBM Distinguished Engineer working on Java, asked me
to post this in response to this thread:
"Andrew's advice is sound. Over-allocating the Java heap is not
desirable for many reasons. The JVM's heap and gc policies should
be appropriately tuned. For batch applications, where longer
pause-times are typically okay to trade-off in exchange for
minimal CPU and elapsed time execution, the optThroughput or gencon
policies are likely most appropriate
(http://www.ibm.com/developerworks/library/j-ibmjava2/). IBM Health
Center offers some pretty good tooling to help tune
the garbage collector
(http://www.ibm.com/developerworks/java/jdk/tools/healthcenter/)."
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN