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
- is related to
-
LOG4J2-1412 Unbox ringbuffer size should be configurable
- Closed