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

Reduce memory overhead using thread locals with non-reusable messages

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.13.0
    • Fix Version/s: 2.13.1
    • Component/s: None
    • Labels:
      None

      Description

      Using ParameterizedMessageFactory (non-reusable) with thread locals for asynchronous logging results in unused object parameter arrays and empty StringBuilder buffers.
      We can update RingBufferLogEvent and MutableLogEvent to create both the StringBuilder buffer and parameter array lazily in order to avoid the memory overhead entirely when reusable messages are not used.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ckozak Carter Kozak
                Reporter:
                ckozak Carter Kozak
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h