You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2016/09/18 10:41:21 UTC

[jira] [Closed] (LOG4J2-1417) Unbox should respect Constants.ENABLE_THREADLOCALS

     [ https://issues.apache.org/jira/browse/LOG4J2-1417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma closed LOG4J2-1417.
-------------------------------
    Resolution: Fixed

> Unbox should respect Constants.ENABLE_THREADLOCALS
> --------------------------------------------------
>
>                 Key: LOG4J2-1417
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1417
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 2.6, 2.6.1
>            Reporter: Remko Popma
>            Assignee: Remko Popma
>             Fix For: 2.6.2
>
>
> 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.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org