Too many anonymous classes that aren't unloaded

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • tbd
    • Affects Version/s: 9
    • Component/s: core-libs
    • None

      class hello {
          public static void main(String[] args) {
            {
              int var = 5;
              System.out.println("Hello World!" + var); // Display "Hello World!"
            }
            for (int i = 0; i < 100 ; i++) {
                // nuke the anonymous classes
                System.gc();
            }
          }
      }

      Creates 17 anonymous classes because of the concatenation of var.

      Printing in Unsafe_Define_AnonymousClass:
      There are 16 different ones of these:
      Anonymous class java.lang.invoke.LambdaForm$BMH/249515771 created host class java.lang.invoke.LambdaForm

      And one of these, which is added as a dependency to the application class loader:
      Anonymous class java.lang.invoke.LambdaForm$MH/586617651 created host class java.lang.invoke.LambdaForm

      This seems crazy inefficient. Also need to figure out why the $BMH are never unloaded.

            Assignee:
            Claes Redestad
            Reporter:
            Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: