Refactor ClassUnloader to provide explicit waiting API

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • 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.

            Assignee:
            Albert Yang
            Reporter:
            Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: