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

(GC) Avoid allocating temporary objects in Filter implementations

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.8
    • Component/s: Filters
    • Labels:
      None

      Description

      Review current Filter implementation classes and change them to be garbage-free where feasible. Document on the web site which filters are garbage free and which are not.

      Current status

      • BurstFilter (allocates, non-trivial to change)
      • CompositeFilter (adding & removing elements produces garbage for thread safety, no allocation in steady state) - since 2.6
      • DynamicThresholdFilter (garbage free since 2.6)
      • LevelRangeFilter (garbage free since 2.8)
      • MapFilter (garbage free since 2.8, but logging a MapMessage still allocates)
      • MarkerFilter (garbage free since 2.8)
      • RegexFilter (not garbagefree due to JDK regex library)
      • ScriptFilter (not garbagefree: creates new Binding object for each event)
      • StructuredDataFilter (garbage free since 2.8)
      • ThreadContextMapFilter (garbage free since 2.8)
      • ThresholdFilter (garbage free since 2.8)
      • TimeFilter (uses Calendar to calculate millisSinceMidnight for each event. Can refactor by reusing some of the FixedDateFormat logic.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rpopma Remko Popma
                Reporter:
                rpopma Remko Popma
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: