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

Slow LoginContext.login() on multi threading application

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
      9
    • Resolved In Build:
      b22
    • Verification:
      Verified

      Backports

        Description

        LoginContext.login() performs slow in comparison with OpenJDK8.
        ServiceLoader lookup ( method ServiceLoader.load() ) performs many times repeatedly, each time when application calls LoginContext.login().
        On multi-threading application, this leads to having a lot of threads waiting for synchronized code URLClassPath.getLoader().

        "HTTP Handler 10.21.48.63" #455 daemon prio=5 os_prio=0 cpu=1828.13ms elapsed=150.65s allocated=195M defined_classes=0 tid=0x000002636709c000 nid=0x4a18 waiting for monitor entry [0x000000aef69fb000]
           java.lang.Thread.State: BLOCKED (on object monitor)
                at jdk.internal.loader.URLClassPath.getLoader(java.base@11.0.11/URLClassPath.java:422)
                - waiting to lock <0x00000007139003c8> (a jdk.internal.loader.URLClassPath)
                at jdk.internal.loader.URLClassPath$1.next(java.base@11.0.11/URLClassPath.java:340)
                at jdk.internal.loader.URLClassPath$1.hasMoreElements(java.base@11.0.11/URLClassPath.java:351)
                at java.net.URLClassLoader$3$1.run(java.base@11.0.11/URLClassLoader.java:687)
                at java.net.URLClassLoader$3$1.run(java.base@11.0.11/URLClassLoader.java:685)
                at java.security.AccessController.doPrivileged(java.base@11.0.11/Native Method)
                at java.net.URLClassLoader$3.next(java.base@11.0.11/URLClassLoader.java:684)
                at java.net.URLClassLoader$3.hasMoreElements(java.base@11.0.11/URLClassLoader.java:709)
                at java.lang.CompoundEnumeration.next(java.base@11.0.11/ClassLoader.java:3032)
                at java.lang.CompoundEnumeration.hasMoreElements(java.base@11.0.11/ClassLoader.java:3041)
                at java.lang.CompoundEnumeration.next(java.base@11.0.11/ClassLoader.java:3032)
                at java.lang.CompoundEnumeration.hasMoreElements(java.base@11.0.11/ClassLoader.java:3041)
                at java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(java.base@11.0.11/ServiceLoader.java:1203)
                at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(java.base@11.0.11/ServiceLoader.java:1221)
                at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(java.base@11.0.11/ServiceLoader.java:1265)
                at java.util.ServiceLoader$2.hasNext(java.base@11.0.11/ServiceLoader.java:1300)
                at java.util.ServiceLoader$3.hasNext(java.base@11.0.11/ServiceLoader.java:1385)
        (1) at javax.security.auth.login.LoginContext.invoke(java.base@11.0.11/LoginContext.java:691)
                at javax.security.auth.login.LoginContext$4.run(java.base@11.0.11/LoginContext.java:665)
                at javax.security.auth.login.LoginContext$4.run(java.base@11.0.11/LoginContext.java:663)
                at java.security.AccessController.doPrivileged(java.base@11.0.11/Native Method)
                at javax.security.auth.login.LoginContext.invokePriv(java.base@11.0.11/LoginContext.java:663)
                at javax.security.auth.login.LoginContext.login(java.base@11.0.11/LoginContext.java:574)
                at com.application.server.AuthenticationManager.authenticate_JAAS(AuthenticationManager.java:191)
                at com.application.server.AuthenticationManager.authenticate(AuthenticationManager.java:113)
                at com.application.server.HTTPState.getBasicAuthenticatedUser(HTTPState.java:1183)
                at com.application.server.HTTPState.getAuthenticatedUser(HTTPState.java:1070)
                at com.application.server.HTTPState.processHeader(HTTPState.java:324)
                at com.application.server.Dispatch.processHeader(Dispatch.java:274)
                at com.application.server.Dispatch.run(Dispatch.java:417)
                at com.application.util.pool.PooledThread.run(PooledThread.java:127)

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                inakonechnyy Ilarion Nakonechnyy
                Reporter:
                inakonechnyy Ilarion Nakonechnyy
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: