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

JSON Template Layout JsonWriter formattableBuffer Memory leak

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.14.0, 2.14.1
    • 3.0.0, 2.15.0
    • JsonTemplateLayout
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: