Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3745

Derby can leak classloaders in an app server environment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.3.3.0, 10.4.1.3, 10.5.1.1
    • 10.3.3.1, 10.4.2.0, 10.5.1.1
    • Services
    • None
    • Security

    Description

      A user reported potential class loader leaks in Derby

      ...The first one looks like Derby created a long-running
      thread and copying the context class loader. To fix, the
      context class loader should be saved/set/restored around the
      creation of the new thread so that it copies some benign class
      loader instead (e.g., null or getClass().getClassLoader()):

      0x42278e58 java/lang/Thread@302e302e
      [truncating at running thread LEAK]

      Object: 0x42278e58 java/lang/Thread@302e302e
      Children:
      0x42278ee0 java/lang/String@303f303f
      0x4226e558 java/lang/ThreadGroup@6f2e6f2e
      0x42278e40
      org/apache/derby/impl/services/monitor/AntiGC@603a603a
      0x419cfac0

      The second is another long running thread. The same applies:

      0x426fe7a0 java/lang/Thread@19901990
      [truncating at running thread LEAK]

      Object: 0x426fe7a0 java/lang/Thread@19901990
      Parents:
      0x4226e5a8 [Ljava/lang/Thread;@6f386f38
      0x426fe548
      org/apache/derby/iapi/services/context/ContextManager@19421942
      Children:
      0x426fe838 java/lang/String@19a319a3
      0x4226e558 java/lang/ThreadGroup@6f2e6f2e
      0x426fe4f8
      org/apache/derby/impl/services/daemon/BasicDaemon@19381938
      0x419cfac0

      The third is a TimerThread owneed , which is created when a
      Timer is created. The same applies:

      0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
      [truncating at running thread LEAK]

      Object: 0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a
      Parents:
      0x41faaf58 [Ljava/lang/Thread;@3c583c58

      Object: 0x425ac510 java/util/Timer@6b856b85
      Parents:
      0x425ac500
      org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25
      6e2

      For more info, see thread at:
      http://www.nabble.com/ClassLoader-leaks--td18121374.html

      Attachments

        1. cdevbabejgjd.html
          10 kB
          Katherine Marsden
        2. derby.log
          15 kB
          Dag H. Wanvik
        3. derby-3745_10.3_diff.txt
          9 kB
          Katherine Marsden
        4. derby-3745_10.3_diff2.txt
          10 kB
          Katherine Marsden
        5. derby3745_backport_to_104_diff_v1.txt
          15 kB
          Mamta A. Satoor
        6. derby3745_backport_to_104_stat_v1.txt
          0.4 kB
          Mamta A. Satoor
        7. derby-3745_BaseMonitor_cleanup_diff.txt
          2 kB
          Katherine Marsden
        8. derby-3745_doc_diff.txt
          2 kB
          Katherine Marsden
        9. derby-3745_fix_build_warning_diff.txt
          2 kB
          Katherine Marsden
        10. derby-3745_policy_files_diff.txt
          2 kB
          Katherine Marsden
        11. derby-3745_removePrivThreadOps_diff.txt
          15 kB
          Katherine Marsden
        12. derby-3745_trunk_diff.txt
          7 kB
          Katherine Marsden

        Issue Links

          Activity

            People

              kmarsden Katherine Marsden
              kmarsden Katherine Marsden
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: