JDK-8139594 : Some G1 policy code tries to get a prediction on an empty sequence
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2015-10-14
  • Updated: 2019-02-11
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Some code in G1CollectorPolicy in some circumstances tries to get predictions from TruncatedSeqs that have no samples.

This can be verified by adding an assert(seq->num() > 0) in G1Predictions::get_new_prediction()

At least this is a strange behavior that should either be fixed or documented.

The attached change is a reverse diff that implements the assert and initial changes. It seems that mostly calling G1CollectorPolicy::update_young_list_target_length() is affected.

Failing test case with these changes applied would be a Java program that immediately calls System.gc().
Comments
P5 because this is just a bad coding issue or insufficient documentation. There is no real error here.
14-10-2015

8139594.diff is a reverse diff, apply the diff file with -R; the attached Hello.java is an example program still failing.
14-10-2015