TLAB allocation path asks collected heap about the max tlab size currently available. But, in Epsilon code, there is discrepancy: the caller interprets the returned value in bytes, while Epsilon code has the size in words. Every other GC adjusts accordingly, Epsilon should too.
Fix:
diff -r c8bc506106e3 src/hotspot/share/gc/epsilon/epsilonHeap.cpp
--- a/src/hotspot/share/gc/epsilon/epsilonHeap.cpp Thu Sep 05 11:09:12 2019 +0200
+++ b/src/hotspot/share/gc/epsilon/epsilonHeap.cpp Thu Sep 05 11:35:57 2019 +0200
@@ -108,12 +108,12 @@
return memory_pools;
}
size_t EpsilonHeap::unsafe_max_tlab_alloc(Thread* thr) const {
// Return max allocatable TLAB size, and let allocation path figure out
- // the actual TLAB allocation size.
- return _max_tlab_size;
+ // the actual allocation size. Note: result should be in bytes.
+ return _max_tlab_size * HeapWordSize;
}
EpsilonHeap* EpsilonHeap::heap() {
CollectedHeap* heap = Universe::heap();
assert(heap != NULL, "Uninitialized access to EpsilonHeap::heap()");