JDK-8054326 : Confusing message in "Current rem set statistics"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 8u40
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-08-05
  • Updated: 2016-10-13
  • Resolved: 2016-05-06
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.
8u112Fixed 9 b120Fixed
"Max = 0K" in the following "Current rem set statistics" is confusing.

  Total heap region code root sets sizes = 98K.  Max = 0K.
           0K (  0.7%) by 93 Young regions
           0K (  0.0%) by 4 Humonguous regions
           0K (  0.6%) by 79 Free regions
          96K ( 98.6%) by 336 Old regions
    79865 code roots represented.
            0 (  0.0%) elements by 93 Young regions
            0 (  0.0%) elements by 4 Humonguous regions
            0 (  0.0%) elements by 79 Free regions
        79865 (100.0%) elements by 336 Old regions
    Region with largest amount of code roots =
511:(E)[0x00000000ffc00000,0x0000000100000000,0x0000000100000000], size = 0K,
num_elems = 0. 

The size (i.e., in "Max" and "size") reported seems to be limited to
"strongly" reachable.

If the the max of code root sets size is 0K.  The total should be 0K too.
Hence the confusing part.

The following flags have been used for the summary report:

-XX:+UnlockDiagnosticVMOptions -XX:+G1SummarizeRSetStats

Impact: Low, wrong ouput but no impact on correctness of product Likelihood: High, will happen every time Workaround: High, there is no workaround ILW = LHH => P4

The problem is caused by rounding. The result is as it is because taking the maximum of a region's code root size and individually rounding it down results to 0k, but the sum of the code root sizes (79k of them, taking 98k of space, for 512 regions) simply is not only 0k.