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

[REDO] MemberNameTable doesn't purge stale entries

    Details

    • Subcomponent:
    • Introduced In Version:
    • Resolved In Build:
      b159
    • CPU:
      x86_64
    • OS:
      generic

      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

                • Assignee:
                  kevinw Kevin Walls
                  Reporter:
                  coleenp Coleen Phillimore
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: