xiang ming created LOG4J2-3092:
----------------------------------

             Summary: 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
         Environment: <log4j2.version>2.14.1</log4j2.version>
            Reporter: xiang ming
         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 neverGetting 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)

Reply via email to