Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8152271

MemberNameTable doesn't purge stale entries

    XMLWordPrintable

Details

    • b126
    • x86_64
    • generic
    • Fix failed

    Backports

      Description

        FULL PRODUCT VERSION :


        A DESCRIPTION OF THE PROBLEM :
        Calling findSpecial is leaking memory.

        THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

        THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        import java.lang.invoke.*;

        public class Leak {
          public void callMe() {
          }
          
          public static void main(String[] args) throws Throwable {
            Leak leak = new Leak();
            
            while(true) {
              MethodHandles.Lookup lookup = MethodHandles.lookup();
              MethodType mt = MethodType.fromMethodDescriptorString("()V", Leak.class.getClassLoader());
              // findSpecial leaks some native mem
              MethodHandle mh = lookup.findSpecial(Leak.class, "callMe", mt, Leak.class);
              mh.invokeExact(leak);
            }
          }
        }

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        Expected: No increase in memory
        Result: Increase in memory
        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.lang.invoke.*;

        public class Leak {
          public void callMe() {
          }
          
          public static void main(String[] args) throws Throwable {
            Leak leak = new Leak();
            
            while(true) {
              MethodHandles.Lookup lookup = MethodHandles.lookup();
              MethodType mt = MethodType.fromMethodDescriptorString("()V", Leak.class.getClassLoader());
              // findSpecial leaks some native mem
              MethodHandle mh = lookup.findSpecial(Leak.class, "callMe", mt, Leak.class);
              mh.invokeExact(leak);
            }
          }
        }
        ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

                coleenp Coleen Phillimore
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: