Axiom
  1. Axiom
  2. AXIOM-354

Potential class loader leak caused by the thread local in org.apache.axiom.util.UIDGenerator

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.10
    • Fix Version/s: 1.2.12
    • Component/s: API
    • Labels:
      None

      Description

      UIDGenerator uses a ThreadLocal with a value class that belongs to Axiom (namely UIDGeneratorImpl). Since the ThreadLocal is never cleaned up explicitly (doing that would break the UIDGenerator), this may cause a class loader leak (i.e. in a Web application, it may prevent the class loader from being garbage collected when the application is stopped). Since UIDGeneratorImpl basically stores 3 values of type long, it should be easy to refactor the code so that the value class ThreadLocal is not loaded from the application class loader (e.g. by using long[] as value class). However, I first need to confirm that there is really a class loader leak here.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        164d 7h 38m 1 Andreas Veithen 22/Jun/11 22:39
        In Progress In Progress Resolved Resolved
        20h 42m 1 Andreas Veithen 23/Jun/11 19:22
        Resolved Resolved Closed Closed
        14d 56m 1 Andreas Veithen 07/Jul/11 20:19
        Andreas Veithen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Andreas Veithen added a comment -

        For an in-depth discussion of this type of issue and how the issue was detected, see here:

        http://code.google.com/p/arit/wiki/ThreadLocal

        Show
        Andreas Veithen added a comment - For an in-depth discussion of this type of issue and how the issue was detected, see here: http://code.google.com/p/arit/wiki/ThreadLocal
        Hide
        Hudson added a comment -

        Integrated in ws-axiom-trunk #413 (See https://builds.apache.org/job/ws-axiom-trunk/413/)
        AXIOM-354: Refactored UIDGenerator to avoid a class loader leak.

        veithen :
        Files :

        • /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/UIDGenerator.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/UIDGeneratorImpl.java
        Show
        Hudson added a comment - Integrated in ws-axiom-trunk #413 (See https://builds.apache.org/job/ws-axiom-trunk/413/ ) AXIOM-354 : Refactored UIDGenerator to avoid a class loader leak. veithen : Files : /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/UIDGenerator.java /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/UIDGeneratorImpl.java
        Andreas Veithen made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Andreas Veithen added a comment -

        Confirmed that the thread local indeed causes a class loader leak.

        Solved the issue by refactoring the code to use a simple long[] as thread local value.

        Show
        Andreas Veithen added a comment - Confirmed that the thread local indeed causes a class loader leak. Solved the issue by refactoring the code to use a simple long[] as thread local value.
        Andreas Veithen made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Andreas Veithen made changes -
        Assignee Andreas Veithen [ veithen ]
        Andreas Veithen made changes -
        Field Original Value New Value
        Fix Version/s 1.2.12 [ 12316132 ]
        Andreas Veithen created issue -

          People

          • Assignee:
            Andreas Veithen
            Reporter:
            Andreas Veithen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development