Skip to content

Commit

Permalink
Merge pull request #3515 from amicic/lower_init_age
Browse files Browse the repository at this point in the history
Initial Tenure Age
  • Loading branch information
charliegracie authored Feb 6, 2019
2 parents 4612762 + 917c983 commit d68d38c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions gc/base/GCExtensionsBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1410,10 +1410,10 @@ class MM_GCExtensionsBase : public MM_BaseVirtual {
, scavengerScanOrdering(OMR_GC_SCAVENGER_SCANORDERING_HIERARCHICAL)
#endif /* OMR_GC_MODRON_SCAVENGER || OMR_GC_VLHGC */
#if defined(OMR_GC_MODRON_SCAVENGER)
, scvTenureRatioHigh(J9_SCV_TENURE_RATIO_HIGH)
, scvTenureRatioLow(J9_SCV_TENURE_RATIO_LOW)
, scvTenureRatioHigh(OMR_SCV_TENURE_RATIO_HIGH)
, scvTenureRatioLow(OMR_SCV_TENURE_RATIO_LOW)
, scvTenureFixedTenureAge(OBJECT_HEADER_AGE_MAX)
, scvTenureAdaptiveTenureAge(J9_OBJECT_HEADER_AGE_DEFAULT)
, scvTenureAdaptiveTenureAge(0)
, scvTenureStrategySurvivalThreshold(0.99)
, scvTenureStrategyFixed(false)
, scvTenureStrategyAdaptive(true)
Expand Down
13 changes: 13 additions & 0 deletions gc/base/standard/Scavenger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,19 @@ MM_Scavenger::masterSetupForGC(MM_EnvironmentStandard *env)
scavengerStats->_tenureSpaceAllocBytesAcumulation += heapStatsTenureSpace._allocBytes;
scavengerStats->_semiSpaceAllocBytesAcumulation += heapStatsSemiSpace._allocBytes;

/* Check if scvTenureAdaptiveTenureAge has not been initialized or forced (by cmdline option) */
if (0 == _extensions->scvTenureAdaptiveTenureAge) {
/* With larger initial Nursery sizes, we'll reduce initial tenure age, to help promote peristant object sooner. */
_extensions->scvTenureAdaptiveTenureAge = OMR_OBJECT_HEADER_AGE_DEFAULT;

uintptr_t tenureAgeAdjustement = MM_Math::floorLog2(_extensions->heap->getActiveMemorySize(MEMORY_TYPE_NEW) / MINIMUM_NEW_SPACE_SIZE);
if (tenureAgeAdjustement < _extensions->scvTenureAdaptiveTenureAge) {
_extensions->scvTenureAdaptiveTenureAge -= tenureAgeAdjustement;
} else {
_extensions->scvTenureAdaptiveTenureAge = 1;
}
}

/* Record the tenure mask */
_tenureMask = calculateTenureMask();

Expand Down
6 changes: 3 additions & 3 deletions include_core/omrgcconsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,10 @@ typedef enum {
#define J9VMGC_SIZECLASSES_LOG_SMALLEST 0x4

/* Default object age for generational collectors */
#define J9_OBJECT_HEADER_AGE_DEFAULT 0xA
#define OMR_OBJECT_HEADER_AGE_DEFAULT 0x9

#define J9_SCV_TENURE_RATIO_LOW 10
#define J9_SCV_TENURE_RATIO_HIGH 30
#define OMR_SCV_TENURE_RATIO_LOW 10
#define OMR_SCV_TENURE_RATIO_HIGH 30
#define OMR_SCV_REMSET_FRAGMENT_SIZE 32
#define OMR_SCV_REMSET_SIZE 16384

Expand Down

0 comments on commit d68d38c

Please sign in to comment.