Skip to content

Commit

Permalink
Initial Tenure Age
Browse files Browse the repository at this point in the history
Initial Tenure Age will be a function of initial Nursery size. With
larger initial Nursery heaps, initial Tenure Age will be lower. This
helps promoting persistent objects (typically created at startup)
sooner, which reduces startup time and Nursery growth. See:
#3514

For Nursery Sizes of
256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M, >=64M

initial Tenure Age is set respectively to:

9, 8, 7, 6, 5, 4, 3, 2, 1.

For OpenJ9, which starts with 2M Nursery, this will reduce the default
initial Tenure Age to 6 (from 10).

Signed-off-by: Aleksandar Micic <amicic@ca.ibm.com>
  • Loading branch information
amicic committed Jan 25, 2019
1 parent 6121d1d commit 917c983
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
Expand Up @@ -1403,10 +1403,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
Expand Up @@ -409,6 +409,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
Expand Up @@ -464,10 +464,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 917c983

Please sign in to comment.