JDK-8006242 : G1: WorkerDataArray::verify() too strict for double calculations
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-01-14
  • Updated: 2013-09-18
  • Resolved: 2013-01-21
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.
JDK 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Description
In non-product builds the WorkerDataArrays in G1 are initialized to -1 in WorkerDataArray<T>::reset() when a GC starts. At the end of a GC WorkerDataArray<T>::verify() verifies that all entries in a WorkerDataArray has been set. Currently it does this by asserting that the entries are >= 0. This is fine in theory since the entries should contain counts or times that are all positive.

The problem is that some WorkerDataArrays are of type double. And some of those are set up through calculations using doubles. If those calculations result in a value close to 0 we could end up with a value slightly less than 0 since double calculations don't have full precision.

All we really want to verify is that all the entries were set. So, it should be enough to verify that entries do not contain the value set by the reset() method.