JDK-8249528 : Remove obsolete comment in G1RootProcessor::process_java_roots
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-07-15
  • Updated: 2021-04-22
  • Resolved: 2021-04-19
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 17
17 b19Fixed
Related Reports
Relates :  
Description
In G1RootProcessor::process_java_roots there is this comment:

  // We need to make make sure that the "strong" nmethods are processed first
  // using the strong closure. Only after that we process the weakly reachable
  // nmethods.
  // We need to strictly separate the strong and weak nmethod processing because
  // any processing claims that nmethod, i.e. will not be iterated again.
  // Which means if an nmethod is processed first and claimed, the strong processing
  // will not happen, and the oops reachable by that nmethod will not be marked
  // properly.
  //
  // That is why we process strong nmethods first, synchronize all threads via a
  // barrier, and only then allow weak processing. To minimize the wait time at
  // that barrier we do the strong nmethod processing first, and immediately after-
  // wards indicate that that thread is done. Hopefully other root processing after
  // nmethod processing is enough so there is no need to wait.
  //
  // This is only required in the concurrent start pause with class unloading enabled.

After JDK-8230706 the process is quite different and this comment only confusing the reader.
Comments
Changeset: c607d12e Author: Albert Mingkun Yang <ayang@openjdk.org> Date: 2021-04-19 07:04:26 +0000 URL: https://git.openjdk.java.net/jdk/commit/c607d12e
19-04-2021