JDK-8114823 : G1 doesn't honor request to disable class unloading
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-06-16
  • Updated: 2019-01-14
  • Resolved: 2016-09-12
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 8 JDK 9
8u192Fixed 9 b138Fixed
Related Reports
Relates :  
Relates :  
Description
Class unloading should be disabled by -XX:-ClassUnloading (or the equivalent -Xnoclassgc).  However, G1 does not honor such requests correctly.

When G1 performs a full GC, it does not conditionalize the marking phase of root processing based on the ClassUnloading option.  Instead it always marks the roots as if class unloading is enabled.  Unfortunately, later code does attempt to honor ClassUnloading, with resulting problems.

When G1 performs a concurrent mark, it conditionalizes some of the work on the ClassUnloadingWithConcurrentMark option, which defaults to true.  That feature is not disabled when ClassUnloading is requested disabled, so it is presently possible to have ClassUnloading false and ClassUnloadingWithConcurrentMark true.  As a result, later processing that is disabled when ClassUnloading is disabled may go awry.


Comments
webrev for 8u backport - http://cr.openjdk.java.net/~fmatte/8114823/webrev.00/
19-07-2018

Regression test exists.
26-07-2017

ILW = High (VM hang), Medium (not everytime / g1 only), Low (enable class unloading) = P2
17-06-2015

There is a conjecture that JDK-8059128 (closed as incomplete) may have been a variation of this problem.
16-06-2015

JDK-8085965 is the CMS variation of the problem. This bug is the G1 variation.
16-06-2015