JDK-8059604 : Add CompileThresholdScaling flag to control when methods are first compiled (with +/-TieredCompilation)
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-10-02
  • Updated: 2015-06-03
  • Resolved: 2014-10-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
9 b37Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8169586 :  
This issue is related to JDK-8050853, which proposes per-method compilation thresholds (thresholds that control after how many iterations a method is compiled). 

JDK-8050853 splits up the task of adding per-method compilation thresholds into three parts:

1. General support of flags with value in option command (JDK-8055286 and JDK-8056964)
2. Make use of CompileThreshold in Tiered. (the current issue)
3. Per method compilation threshold. (JDK-8059606)

The current issue corresponds to Part 2 "Make use of CompileThreshold in Tiered".

With tiered compilation disabled, controlling when compilation happens is straightforward, as only the value of the CompileThreshold flag must be set. With tiered compilation enabled, controlling when compilation happens is more complicated : To control when a method is first compiled, the value of a number of flags (typically Tier3InvocationThreshold, Tier3inInvocationThreshold, Tier3CompileThreshold, and Tier0InvokeNotifyFreqLog) must be altered.

We propose a new flag, CompileThresholdScalingPercentage, that controls compilation for both the tiered- and the non-tiered modes of operation. CompileThresholdScaling has an integer value between 0 and +Inf and scales the thresholds corresponding to the current mode of operation (tiered resp. non-tiered).

With tiered compilation disabled, CompileThresholdScalingPercentage the compliation threshold is set to CompileThreshold * CompileThresholdScalingPercentage. If CompileThresholdScalingPercentage == 0, each method is compiled on its first invocation. If 0 < CompileThresholdScalingPercentage < 100, all methods are compiled earlier than a CompileThreshold number of iterations (after CompileThresholdScalingPercentage * CompileThreshold number of iterations). If CompileThresholdScalingPercentage > 100, all methods are compiled later. The default value of CompileThresholdScalingPercentage is 100, that is, all methods are compiled as specified by the CompileThreshold flag.

With tiered compilation enabled, Tier3InvocationThreshold, Tier3MinInvocationThreshold, Tier3CompileThreshold are scaled (i.e., are multiplied with CompileThresholdScalingPercentage), Tier3InvokeNotifyFreqLog is ajusted by adding log2(CompileThresholdScalingPercentage) to it.

The advantage of having a single flag is that

- with tiered compilation enabled the user does not have to be aware of the internals of the AdvancedThresholdPolicy (i.e., the way compilation is controlled)
- there is a single flag no matter is the VM is operating with tiered compilation enabled/disabled.