OptaPlanner - What is the fastest Garbage Collector in Java 8?
There is a proposal to make G1 the default Garbage Collector in OpenJDK9 for servers. My first reaction is to reject this proposal:
-
G1 is
17.60%
is slower on average. -
G1 is consistently slower on every use case for every dataset.
-
On the biggest dataset (Machine Reassignment B10), which dwarfs any of the other datasets in size, G1 is
34.07%
is slower. -
If the default GC differs between developer machines and servers, then developer benchmarks become less trustworthy.
On the other hand, there are a few nuances to note:
-
G1 focuses on limiting GC pauses, instead of throughput. For these use cases (with heavy calculations) GC pause length mostly doesn't matter.
-
This was an (almost) single threaded benchmark. Further benchmarking with multiple solvers in parallel or multi-threaded solving might influence results.
-
G1 is recommended for a heap size of at least
6 GB
. This benchmark used a heap size of only2 GB
and even that size is only needed for the biggest dataset (Machine Reassignment B10).
Heavy calculations is just one of the many things that OpenJDK is used for: it's just 1 stakeholder in this community wide debate. If other stakeholders (such as web services) prove otherwise, maybe it's worth changing the default GC. But show me the benchmarks on real projects first!
Read full article from OptaPlanner - What is the fastest Garbage Collector in Java 8?
No comments:
Post a Comment