-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: None
-
Component/s: core-svc
Refactor ClassUnloader to decouple triggering a full GC from waiting for class reclamation. The original unloadClass() implementation contained an implicit wait loop that offered no context on why waiting was necessary.
Since the need to wait is caller-specific (e.g., due to JDWP or compiler references), this patch makes the intent explicit:
- unloadClass(): Triggers a single GC. Suitable for callers that don't need to wait.
- unloadClassAndWait(timeout): Explicit waiting API.
This shifts the responsibility of deciding to wait—and documenting the rationale—to the caller, leading to clearer test code.
Since the need to wait is caller-specific (e.g., due to JDWP or compiler references), this patch makes the intent explicit:
- unloadClass(): Triggers a single GC. Suitable for callers that don't need to wait.
- unloadClassAndWait(timeout): Explicit waiting API.
This shifts the responsibility of deciding to wait—and documenting the rationale—to the caller, leading to clearer test code.
- relates to
-
JDK-8375485 Tests in vmTestbase/nsk are failing due to missing class unloading after 8373945
-
- Resolved
-
- links to
-
Review(master)
openjdk/jdk/29735