mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-28 22:32:55 +00:00
8359947: GenShen: use smaller TLABs by default
Reviewed-by: phh, xpeng
This commit is contained in:
parent
7576064a10
commit
a0c3efa6a8
@ -184,9 +184,10 @@ void ShenandoahArguments::initialize() {
|
||||
// Current default is good for generational collectors that run frequent young GCs.
|
||||
// With Shenandoah, GC cycles are much less frequent, so we need we need sizing policy
|
||||
// to converge faster over smaller number of resizing decisions.
|
||||
if (FLAG_IS_DEFAULT(TLABAllocationWeight)) {
|
||||
if (strcmp(ShenandoahGCMode, "generational") && FLAG_IS_DEFAULT(TLABAllocationWeight)) {
|
||||
FLAG_SET_DEFAULT(TLABAllocationWeight, 90);
|
||||
}
|
||||
// In generational mode, let TLABAllocationWeight keeps its default value of 35.
|
||||
|
||||
if (GCCardSizeInBytes < ShenandoahMinCardSizeInBytes) {
|
||||
vm_exit_during_initialization(
|
||||
@ -217,6 +218,10 @@ void ShenandoahArguments::initialize_alignments() {
|
||||
}
|
||||
SpaceAlignment = align;
|
||||
HeapAlignment = align;
|
||||
|
||||
if (FLAG_IS_DEFAULT(TLABSize)) {
|
||||
TLABSize = MAX2(ShenandoahHeapRegion::region_size_bytes() / 256, (size_t) 32 * 1024);
|
||||
}
|
||||
}
|
||||
|
||||
CollectedHeap* ShenandoahArguments::create_heap() {
|
||||
|
||||
@ -790,8 +790,10 @@ size_t ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) {
|
||||
RegionCount = align_up(max_heap_size, RegionSizeBytes) / RegionSizeBytes;
|
||||
guarantee(RegionCount >= MIN_NUM_REGIONS, "Should have at least minimum regions");
|
||||
|
||||
// Limit TLAB size for better startup behavior and more equitable distribution of memory between contending mutator threads.
|
||||
guarantee(MaxTLABSizeWords == 0, "we should only set it once");
|
||||
MaxTLABSizeWords = align_down(RegionSizeWords, MinObjAlignment);
|
||||
MaxTLABSizeWords = align_down(MIN2(RegionSizeWords, MAX2(RegionSizeWords / 32, (size_t) (256 * 1024) / HeapWordSize)),
|
||||
MinObjAlignment);
|
||||
|
||||
guarantee(MaxTLABSizeBytes == 0, "we should only set it once");
|
||||
MaxTLABSizeBytes = MaxTLABSizeWords * HeapWordSize;
|
||||
|
||||
@ -57,17 +57,17 @@ public class TestOldGrowthTriggers {
|
||||
for (int i = 0; i < ArraySize; i++) {
|
||||
int replaceIndex = r.nextInt(ArraySize);
|
||||
int deriveIndex = r.nextInt(ArraySize);
|
||||
switch (i & 0x3) {
|
||||
case 0:
|
||||
switch (i & 0x7) {
|
||||
case 0,1,2:
|
||||
// creates new old BigInteger, releases old BigInteger,
|
||||
// may create ephemeral data while computing gcd
|
||||
array[replaceIndex] = array[replaceIndex].gcd(array[deriveIndex]);
|
||||
break;
|
||||
case 1:
|
||||
case 3,4:
|
||||
// creates new old BigInteger, releases old BigInteger
|
||||
array[replaceIndex] = array[replaceIndex].multiply(array[deriveIndex]);
|
||||
break;
|
||||
case 2,3:
|
||||
case 5,6,7:
|
||||
// do nothing, let all objects in the array age to increase pressure on old generation
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user