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

Compression with TimeBasedRollingPolicy leaks a thread which blocks the application to shutdown + leads to severe memory leak in webapps

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: logback-core
    • Labels:
      None
    • Environment:

      1.5,1.6 JDK

      Description

      Hi,

      the TimeBasedRollingPolicy uses the AsynchronousCompressor class to perform the compression in a background thread. In the AsyncCompressor every compress creates a ThreadPool with one thread which is never stopped. After compression the thread will wait on a queue to be fed with new task which will never happen again and there is now chance to stop the thread manually, because the reference to the ExecutorService is lost.

      Because the thread is not stoped and it is not a deamon thread, the JVM can not shutdown. In web env this bug causes the leak of the application's classloader.

      A simple solution is to create a simple thread to perform the compression instead of using an ExecutorService.

      Regards,
      Zoltan Szel

        Attachments

          Activity

            People

            • Assignee:
              ceki Ceki Gülcü
              Reporter:
              zoliszel Szel Zoltan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: