You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2019/07/17 15:28:00 UTC

[jira] [Commented] (LOG4J2-1341) (GC) Avoid allocating temporary objects in Pattern Converters for PatternLayout

    [ https://issues.apache.org/jira/browse/LOG4J2-1341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16887167#comment-16887167 ] 

Ralph Goers commented on LOG4J2-1341:
-------------------------------------

Why is this issue still open? Is it possible to make the remaining pattern converters garbage free? If not, they should simply be documented.

> (GC) Avoid allocating temporary objects in Pattern Converters for PatternLayout
> -------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1341
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1341
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Pattern Converters
>    Affects Versions: 2.5
>            Reporter: Remko Popma
>            Priority: Major
>
> *To do*
> The following pattern converters can be modified to avoid creating temporary objects in their {{format}} method:
> * -all done-
> *Investigate*
> The following pattern converters may be difficult to modify since they rely on JDK components that create temporary objects:
> * (-) ExtendedThrowablePatternConverter
> * (-) RegexReplacementConverter
> * (-) RootThrowablePatternConverter
> * (-) ThrowablePatternConverter
> * (-) UuidPatternConverter
> * (-) ClassNamePatternConverter (location information requires creating StackTraceElements)
> * (-) FileLocationPatternConverter
> * (-) FullLocationPatternConverter
> * (-) LineLocationPatternConverter
> * (-) MethodLocationPatternConverter
> *Done*
> The following pattern converters already do not allocate temporary objects in their format method:
> * (/) AbstractStyleNameConverter (since 2.8)
> * (/) HighlightConverter (since 2.7, thanks to Richard Zschech)
> * (/) StyleConverter (since 2.7, thanks to Richard Zschech)
> * (/) DatePatternConverter
> * (/) EqualsIgnoreCaseReplacementConverter (since 2.8)
> * (/) EqualsReplacementConverter (since 2.8)
> * (/) EncodingPatternConverter (since 2.8)
> * (/) IntegerPatternConverter (since 2.8)
> * (/) LevelPatternConverter
> * (/) LineSeparatorPatternConverter
> * (/) LiteralPatternConverter (unless literal contains '${')
> * (/) LoggerPatternConverter
> * (/) MapPatternConverter (since 2.8 - note that constructing a MapMessage is not garbage-free)
> * (/) MarkerPatternConverter (since 2.8)
> * (/) MarkerSimpleNamePatternConverter
> * (/) MaxLengthConverter (since 2.8)
> * (/) MdcPatternConverter (since 2.7)
> * (/) MessagePatternConverter (unless a Jansi or HTML renderer is configured or message has '${' lookups)
> * (/) NamePatternConverter
> * (/) NanoTimePatternConverter
> * (/) NdcPatternConverter (since 2.8 ContextStack implementations implement the StringBuilderFormattable interface - note that the ThreadContext stack is cloned for each log event and is not garbage-free)
> * (/) RelativeTimePatternConverter (since 2.8)
> * (/) SequenceNumberPatternConverter (since 2.8)
> * (/) ThreadIdPatternConverter
> * (/) ThreadNamePatternConverter
> * (/) ThreadPriorityPatternConverter
> * (/) VariablesNotEmptyReplacementConverter (since 2.8)



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)