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

Unbox should respect Constants.ENABLE_THREADLOCALS

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6, 2.6.1
    • Fix Version/s: 2.6.2
    • Component/s: API
    • Labels:
      None

      Description

      The org.apache.logging.log4j.util.Unbox class stores a non-JDK class (Unbox$State) in a static ThreadLocal field.

      This may cause memory leaks in containers which share thread pools between applications.

      One way to accomplish this is to have two ThreadLocal fields: one that stores an array of StringBuilders, and one that stores an AtomicLong to track the current slot.

      (If there is a performance impact we can switch between alternative implementations depending on the value of Constants.ENABLE_THREADLOCALS.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                remkop@yahoo.com Remko Popma
                Reporter:
                remkop@yahoo.com Remko Popma
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: