We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e456f8b commit 6b4fa86Copy full SHA for 6b4fa86
src/hotspot/share/gc/g1/g1Allocator.cpp
@@ -191,11 +191,14 @@ size_t G1Allocator::unsafe_max_tlab_alloc() {
191
uint node_index = current_node_index();
192
HeapRegion* hr = mutator_alloc_region(node_index)->get();
193
size_t max_tlab = _g1h->max_tlab_size() * wordSize;
194
- if (hr == nullptr) {
+
195
+ if (hr == nullptr || hr->free() < MinTLABSize) {
196
+ // The next TLAB allocation will most probably happen in a new region,
197
+ // therefore we can attempt to allocate the maximum allowed TLAB size.
198
return max_tlab;
- } else {
- return clamp(hr->free(), MinTLABSize, max_tlab);
199
}
200
201
+ return MIN2(hr->free(), max_tlab);
202
203
204
size_t G1Allocator::used_in_alloc_regions() {
0 commit comments