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

MemberNameTable doesn't purge stale entries

XMLWordPrintable

    • b126
    • x86_64
    • generic
    • Fix failed

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

          1. LeakAnalysis.txt
            129 kB
            Michael Haupt
          2. LeakVAnalysis.txt
            127 kB
            Michael Haupt

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

                Created:
                Updated:
                Resolved: