Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3092

JSON Template Layout JsonWriter formattableBuffer Memory leak

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.14.0, 2.14.1
    • Fix Version/s: 3.0.0, 2.15.0
    • Component/s: JsonTemplateLayout
    • Labels:
      None

      Description

      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.:

       

      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";
      }
      
      

       

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vy Volkan Yazici
                Reporter:
                xmh51 xmh51
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: