Hi to all,

I'm using lo4j2-2.5 and I have some memory usage problems with
AbstractStringLayout.getStringBuilder(). If I write a very long line
of log, the memory used by this line of log is never cleaned.

In the code, I see result.setLength(0) that sets the current size to
0, but the buffer of the string builder remains as long as it is.

Should be ok to use something like this:

result.setLength(0);
result.setLength(DEFAULT_STRING_BUILDER_SIZE);
result.trimToSize();

I have another question, why we should use a threadlocal to get an
empty StringBuilder?

Regards,
Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to