Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2880

High CPU consumption using StackWalker

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11.1, 2.11.2, 2.12.0, 2.12.1, 2.13.0, 2.13.1, 2.13.2, 2.13.3
    • 2.14.0
    • Core
    • None
    • log4j version: 2.12.1

      JDK version: OpenJDK 11.0.6

    Description

      While using OpenJDK 11, there are possibility cause severe CPU consumption because of JDK bug in using StackWalker. 

       

      [Application on JDK11 consume 100% CPU after a few hours of uptime|https://bugs.openjdk.java.net/browse/JDK-8222942]

       

      And it happened serveral times on our production environment.

       

       

      Stack trace Is:

      "reactor-http-epoll-1" #75 daemon prio=5 os_prio=0 cpu=25100145.64ms elapsed=306507.26s tid=0x0000556eddcbd000 nid=0x61 runnable  [0x00007f8605443000]"reactor-http-epoll-2" #75 daemon prio=5 os_prio=0 cpu=25100145.64ms elapsed=306507.26s tid=0x0000556eddcbd000 nid=0x61 runnable  [0x00007f8605443000]   java.lang.Thread.State: RUNNABLE at java.lang.StackStreamFactory$AbstractStackWalker.callStackWalk(java.base@11.0.6/Native Method) at java.lang.StackStreamFactory$AbstractStackWalker.beginStackWalk(java.base@11.0.6/StackStreamFactory.java:370) at java.lang.StackStreamFactory$AbstractStackWalker.walk(java.base@11.0.6/StackStreamFactory.java:243) at java.lang.StackWalker.walk(java.base@11.0.6/StackWalker.java:498) at org.apache.logging.log4j.util.StackLocator.calcLocation(StackLocator.java:81) at org.apache.logging.log4j.util.StackLocatorUtil.calcLocation(StackLocatorUtil.java:76) at org.apache.logging.log4j.spi.AbstractLogger.getLocation(AbstractLogger.java:2201) at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2144) at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2127) at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2020) at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1891) at org.apache.logging.log4j.spi.AbstractLogger.info(AbstractLogger.java:1436)

      Attachments

        1. image-2020-06-28-02-42-12-987.png
          41 kB
          Hash Jang
        2. log4j2.xml
          4 kB
          Hash Jang

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zhxhash Hash Jang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: