[ 
https://issues.apache.org/jira/browse/LOG4J2-2724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16976423#comment-16976423
 ] 

Remko Popma commented on LOG4J2-2724:
-------------------------------------

>From memory, The charSequence field is populated when the log(charSequence, 
>...) API is called. In any case, even if both fields are populated they would 
>both reference the same memory so I cannot imagine this consuming 
>significantly more memory. Do you have evidence to the contrary?

> SimpleMessage - message duplication (String and CharSequence fields)
> --------------------------------------------------------------------
>
>                 Key: LOG4J2-2724
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2724
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 2.12.1
>            Reporter: Dzmitry Anikechanka
>            Priority: Minor
>
> org.apache.logging.log4j.message.SimpleMessage class contains 2 fields:
> {code:java}
> private String message;
> private transient CharSequence charSequence; {code}
> These 2 fields contains the message that should be logged.
> So as the result the message is duplicated and it can cause significant 
> payload on memory in case of logging large messages.
> Could you please fix it or explain why the message is duplicated?
> Thanks,
> Dzmitry



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to