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

Reviewed-by: iklam, coleenp
  • Loading branch information
calvinccheung committed Jul 1, 2022
1 parent 09b4032 commit c43bdf7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
3 changes: 0 additions & 3 deletions test/hotspot/jtreg/ProblemList-zgc.txt
Expand Up @@ -27,9 +27,6 @@
#
#############################################################################

runtime/cds/appcds/customLoader/HelloCustom.java 8289257 generic-all
runtime/cds/appcds/customLoader/HelloCustom_JFR.java 8289257 generic-all
runtime/cds/appcds/dynamicArchive/HelloDynamicCustomUnload.java 8289257 generic-all
resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java 8276539 generic-all
serviceability/sa/CDSJMapClstats.java 8276539 generic-all
serviceability/sa/ClhsdbJhisto.java 8276539 generic-all
Expand Down
Expand Up @@ -73,7 +73,7 @@ public static void main(String args[]) throws Exception {
}

URLClassLoader urlClassLoader =
new URLClassLoader("HelloClassLoader" + System.currentTimeMillis(), urls, null);
new URLClassLoader("HelloClassLoader", urls, null);
Class c = Class.forName(className, true, urlClassLoader);
if (keepAlive) {
keptC = c;
Expand All @@ -99,22 +99,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 c43bdf7

@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.