Logger Lookup Much Slower and High CPU on JDK11

Solution Unverified - Updated -

Issue

  • The following code is much slower on JDK11 vs JDK8:
org.slf4j.LoggerFactory.getLogger(LoggerDemoResource.class)
  • Analysis shows the increased time is in StackStreamFactory$AbstractStackWalker.fetchStackFrames(long, long, int, int, Object[]).

  • Threads consuming cpu have the following stack trace:

"default task-3013" #3711 prio=5 os_prio=0 cpu=4592.93ms elapsed=6.92s tid=0x0000000009565800 nid=0x5210 runnable  [0x00007f79eaf0f000]
   java.lang.Thread.State: RUNNABLE
    at java.lang.StackStreamFactory$AbstractStackWalker.fetchStackFrames(java.base@11.0.5/Native Method)
    at java.lang.StackStreamFactory$AbstractStackWalker.fetchStackFrames(java.base@11.0.5/StackStreamFactory.java:386)
    at java.lang.StackStreamFactory$AbstractStackWalker.getNextBatch(java.base@11.0.5/StackStreamFactory.java:322)
    at java.lang.StackStreamFactory$AbstractStackWalker.peekFrame(java.base@11.0.5/StackStreamFactory.java:263)
    at java.lang.StackStreamFactory$AbstractStackWalker.hasNext(java.base@11.0.5/StackStreamFactory.java:351)
    at java.lang.StackStreamFactory$StackFrameTraverser.tryAdvance(java.base@11.0.5/StackStreamFactory.java:593)
    at java.util.Spliterators$1Adapter.hasNext(java.base@11.0.5/Spliterators.java:681)
    at org.jboss.logmanager.JDKSpecific$FindAllWalkFunction.apply(JDKSpecific.java:208)
    at org.jboss.logmanager.JDKSpecific$FindAllWalkFunction.apply(JDKSpecific.java:198)
    at java.lang.StackStreamFactory$StackFrameTraverser.consumeFrames(java.base@11.0.5/StackStreamFactory.java:534)
    at java.lang.StackStreamFactory$AbstractStackWalker.doStackWalk(java.base@11.0.5/StackStreamFactory.java:306)

Environment

  • OpenJDK 11
  • Oracle JDK 11
  • JBoss Enterprise Application Platform (EAP) 7.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content