Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8289257: Some custom loader tests failed due to symbol refcount not d…
…ecremented

Backport-of: c43bdf716596053ebe473c3b3bd5cf89482b9b01
  • Loading branch information
GoeLin committed Oct 4, 2022
1 parent 0464eaf commit 00cab3f
Showing 1 changed file with 0 additions and 11 deletions.
Expand Up @@ -86,22 +86,11 @@ public static void main(String args[]) throws Exception {
ClassUnloadCommon.failIf(!wb.isClassAlive(className), "should be live here");

if (doUnload) {
String loaderName = urlClassLoader.getName();
int loadedRefcount = wb.getSymbolRefcount(loaderName);
System.out.println("Refcount of symbol " + loaderName + " is " + loadedRefcount);

urlClassLoader = null; c = null; o = null;
ClassUnloadCommon.triggerUnloading();
System.out.println("Is CustomLoadee alive? " + wb.isClassAlive(className));
ClassUnloadCommon.failIf(wb.isClassAlive(className), "should have been unloaded");

int unloadedRefcount = wb.getSymbolRefcount(loaderName);
System.out.println("Refcount of symbol " + loaderName + " is " + unloadedRefcount);

// refcount of a permanent symbol will not be decremented
if (loadedRefcount != 65535) {
ClassUnloadCommon.failIf(unloadedRefcount != (loadedRefcount - 1), "Refcount must be decremented");
}
}
}
}

1 comment on commit 00cab3f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.