[
https://issues.apache.org/jira/browse/LOG4J2-3092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17352543#comment-17352543
]
ASF subversion and git services commented on LOG4J2-3092:
---------------------------------------------------------
Commit 44df19934520c487e2dd0672e7deda7d22ff8e05 in logging-log4j2's branch
refs/heads/release-2.x from Volkan Yazici
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=44df199 ]
LOG4J2-3092 Fix JsonWriter memory leaks due to retained excessive buffer growth.
> JSON Template Layout JsonWriter formattableBuffer Memory leak
> -------------------------------------------------------------
>
> Key: LOG4J2-3092
> URL: https://issues.apache.org/jira/browse/LOG4J2-3092
> Project: Log4j 2
> Issue Type: Bug
> Components: JsonTemplateLayout
> Affects Versions: 2.14.0, 2.14.1
> Reporter: xmh51
> Assignee: Volkan Yazici
> Priority: Major
> Fix For: 2.15.0
>
> Attachments: image-2021-05-19-14-35-29-165.png,
> image-2021-05-19-14-35-55-788.png
>
>
> h1. JSON Template Layout
> 1 use recycler is queue or threadLocal
> 2 JsonWriter formattableBuffer receive big string
> 3 the StringBuilder inner char array expansion and length never getting
> smaller
>
> E.g.:
>
> {code:java}
> public Object test() {
> StringBuilder sb=new StringBuilder();
> for(int i=0;i<10;i++){
> for(int j=0;j<10;j++){
> sb.append(UUID.randomUUID());
> }
> log.info(""+sb+sb);
> }
> return "success";
> }
> {code}
>
>
> !image-2021-05-19-14-35-29-165.png!
> !image-2021-05-19-14-35-55-788.png!
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)