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

Garbage creation introduced by LOG4J2-2301

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.11.1
    • Fix Version/s: 3.0.0, 2.11.2
    • Component/s: Core
    • Labels:
      None

      Description

      Reported here: https://github.com/apache/logging-log4j2/pull/251

      Stack Trace TLABs Total TLAB Size(bytes) Pressure(%)
      java.lang.ThreadLocal$ThreadLocalMap.set(ThreadLocal, Object) line: 481 10 3,638,864 56.192
      java.lang.ThreadLocal$ThreadLocalMap.access$100(ThreadLocal$ThreadLocalMap, ThreadLocal, Object) line: 298 10 3,638,864 56.192
      java.lang.ThreadLocal.setInitialValue() line: 184 10 3,638,864 56.192
      java.lang.ThreadLocal.get() line: 170 10 3,638,864 56.192
      org.apache.logging.log4j.core.async.AsyncLoggerConfig.log(LogEvent, LoggerConfig$LoggerConfigPredicate) line: 91 10 3,638,864 56.192

      We clear and re-set a threadlocal value, which plays with the internal thread-map size like an accordion, increasing probability unused thread entries will be removed. By setting back to a default value rather than clearing the threadlocal we can avoid allocation.

        Attachments

          Activity

            People

            • Assignee:
              ckozak Carter Kozak
              Reporter:
              ckozak Carter Kozak
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: