You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Adrien Grand <jp...@gmail.com> on 2017/04/14 07:17:01 UTC

Potential memory leak in ParameterizedMessage

Hello,

While reviewing a heap dump a couple weeks ago, I found that log4j was
using more memory than I would expect, and this turned out to come from a
static ThreadLocal in ParameterizedMessage. Could someone look at the
following issue?
https://issues.apache.org/jira/browse/LOG4J2-1858

Thanks.

Adrien

Re: Potential memory leak in ParameterizedMessage

Posted by Ralph Goers <ra...@dslextreme.com>.
I have a feeling that this is similar to other cases where a StringBuilder is being held in a ThreadLocal to avoid having to reallocate objects. The issue is that the buffer is never reduced in size so it can use up a fair amount of memory.

Ralph

> On Apr 14, 2017, at 8:06 AM, Matt Sicker <bo...@gmail.com> wrote:
> 
> The subject matter expert in that affected code has been swamped with work,
> so I'd imagine that's why it hasn't been looked at yet. If you could
> provide a patch, that should help us get this moving forward, though.
> 
> On 14 April 2017 at 02:17, Adrien Grand <jp...@gmail.com> wrote:
> 
>> Hello,
>> 
>> While reviewing a heap dump a couple weeks ago, I found that log4j was
>> using more memory than I would expect, and this turned out to come from a
>> static ThreadLocal in ParameterizedMessage. Could someone look at the
>> following issue?
>> https://issues.apache.org/jira/browse/LOG4J2-1858
>> 
>> Thanks.
>> 
>> Adrien
>> 
> 
> 
> 
> -- 
> Matt Sicker <bo...@gmail.com>



Re: Potential memory leak in ParameterizedMessage

Posted by Matt Sicker <bo...@gmail.com>.
The subject matter expert in that affected code has been swamped with work,
so I'd imagine that's why it hasn't been looked at yet. If you could
provide a patch, that should help us get this moving forward, though.

On 14 April 2017 at 02:17, Adrien Grand <jp...@gmail.com> wrote:

> Hello,
>
> While reviewing a heap dump a couple weeks ago, I found that log4j was
> using more memory than I would expect, and this turned out to come from a
> static ThreadLocal in ParameterizedMessage. Could someone look at the
> following issue?
> https://issues.apache.org/jira/browse/LOG4J2-1858
>
> Thanks.
>
> Adrien
>



-- 
Matt Sicker <bo...@gmail.com>