Integrated: 8377950: Refactor ClassUnloader to provide explicit waiting API

Albert Mingkun Yang ayang at openjdk.org
Wed Feb 18 10:32:10 UTC 2026


On Mon, 16 Feb 2026 07:45:11 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Separates GC triggering from class reclamation waiting in vmTestbase ClassUnloader.
> 
> The original implementation used an implicit wait loop regardless of caller needs. Because the necessity of waiting is caller-specific, this PR introduces an explicit `unloadClassAndWait(timeout)` API. This allows callers to document their specific reasons for waiting (e.g., race conditions with JDWP or background compilation) while keeping `unloadClass()` simple for those who don't need to wait.
> 
> - Introduced `unloadClassAndWait(timeout)` and simplified `unloadClass()`.
> - Updated `compmethunload001` and `AbstractDebuggeeTest` to use the explicit waiting API with documented rationale.
> 
> Test: tier1-5, `vmTestbase/nsk`

This pull request has now been integrated.

Changeset: 21a07f78
Author:    Albert Mingkun Yang <ayang at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/21a07f78feee8bd37629f60a3505f256d249f03a
Stats:     69 lines in 3 files changed: 38 ins; 21 del; 10 mod

8377950: Refactor ClassUnloader to provide explicit waiting API

Reviewed-by: lmesnik, cjplummer, dholmes, syan

-------------

PR: https://git.openjdk.org/jdk/pull/29735


More information about the serviceability-dev mailing list