JDK-8361706 : Parallel weak klass link cleaning does not clean out previous klasses
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9,11,17,21,25
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-07-09
  • Updated: 2025-07-24
  • Resolved: 2025-07-14
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 26
26 b07Fixed
Related Reports
Causes :  
Description
KlassCleaningTask::work() only calls InstanceKlass::clean_weak_instanceklass_links() on the klasses in the hierarchy, missing old, previously redefined klasses like Klass::clean_weak_klass_links() would do if called with clean_live_klasses = true.

JDK-8156137 missed that location when trying to fix this; however this has been found by code inspection, there is no known crash for this.
Comments
Also affects Shenandoah, AFAICS from the code paths. Its class unloading paths calls KlassCleaningTask::work as well.
24-07-2025

Changeset: 99c299f0 Branch: master Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2025-07-14 09:39:06 +0000 URL: https://git.openjdk.org/jdk/commit/99c299f0985c8be63b9b60e589db520d83fd8033
14-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26263 Date: 2025-07-11 10:38:51 +0000
11-07-2025