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

Permgen leak in AsyncLoggerConfigHelper

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0-beta9
    • 2.0-rc1
    • Appenders
    • None
    • JDK7, Win8 64bit

    Description

      Thread local 'currentLogEvent' is not cleaned on shutdown which prevent web applications clean undeploying.
      Tomcat prints following:

      SEVERE: The web application [/web] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@22410487]) and a value of type [org.apache.logging.log4j.core.impl.Log4jLogEvent] (value [Logger=********* Level=INFO Message=************]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
      

      We use async loggers declared explicitly in log4j2.xml:
      <AsyncLogger name="logger" additivity="false" level="trace"> ......

      We use RollingRandomAccessFile as appender.

      Attachments

        Issue Links

          Activity

            People

              rpopma Remko Popma
              salaev Sergey Alaev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: