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