Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-973

PermGen with orphan async appenders

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.2
    • logback-classic
    • None
    • Java 7, Tomcat 7, Windows, Linux

    Description

      Hello,

      When defining a AsyncAppender in a logback.xml file, if this appender is not used by any logger, it will not be unloaded and then will cause permGen space out of memory.

      This happens on a web app undeploy/redeploy for my particular case.

      I attached 2 configuration files and 2 screenshots to this issue as well as the code I use to free memory, for you to understand what happens.

      If you look at the code, you will see that I free only logger contexts, so it explains why the async appender is not freed. But I don't know yet how to get appenders which are not attached to a logger.

      There is something strange, a orphan AsyncAppender produces this behavior. An orphan RollingFileAppender does not produces it... Perhaps it is caused by the thread created by the Async one ?

      So, IMHO, either:

      • I missed something, and please tell me how to correct it...
      • The "orphan" appenders should not be initialized on logback startup.
      • You could add a "deinitializer" class to handle this issue for everyone.

      Another thing, I added my own listener because the ContextDetachingSCL works only with JNDI, is it really the intended behavior ?

      Best regards,

      (And good job for logback )

      Attachments

        Activity

          People

            logback-dev Logback dev list
            rramillien Régis Ramillien
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: