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

Unbox should respect Constants.ENABLE_THREADLOCALS

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6, 2.6.1
    • 2.6.2
    • API
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rpopma Remko Popma
            rpopma Remko Popma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment