Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ public static void makeOldAllocations() {
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;
}
Expand Down