When using hbase PerformanceEvaluation to do some writing performance tests,I found jdk11 slower by about 20%-30% than jdk8 with -XX:-ResizePLAB.
The returned desired_plab_sz is different between 8 and 11. When disabling ResizePLAB the desired_plab_sz should return default PLAB size, but actually in jdk11 the code returns PLABSize/no_of_gc_workers. JDK8 returns the default PLAB size.
Young/OldPLABSize are different in jdk11, resulting in much more direct allocation in some situations, e.g. hbase PerformanceEvaluation which will create many big objects.
The same result for jdk/jdk
Proposed fix:
diff --git a/src/hotspot/share/gc/shared/plab.cpp b/src/hotspot/share/gc/shared/plab.cpp
index 2afde91..7a5e108 100644
--- a/src/hotspot/share/gc/shared/plab.cpp
+++ b/src/hotspot/share/gc/shared/plab.cpp
@@ -135,6 +135,9 @@ void PLABStats::log_sizing(size_t calculated_words, size_t net_desired_words) {
// Calculates plab size for current number of gc worker threads.
size_t PLABStats::desired_plab_sz(uint no_of_gc_workers) {
+ if (!ResizePLAB) {
+ return _desired_net_plab_sz;
+ }
return align_object_size(clamp(_desired_net_plab_sz / no_of_gc_workers, min_size(), max_size()));
}