Geronimo
  1. Geronimo
  2. GERONIMO-4545

TomcatJAASRealm keeps reference to undeployed EAR/WAR's classloader

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.1.5, 2.2
    • Component/s: Memory Leaks, security, Tomcat
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      Another issue where an undeployed WAR's classloader is not GCed.

      --> org.apache.geronimo.tomcat.realm.TomcatJAASRealm@0x2aaab10ab438 (180 bytes)  (field container:) exclude
      --> org.apache.geronimo.tomcat.GeronimoStandardContext@0x2aaab322d390 (749 bytes) (field parentClassLoader:) exclude
      --> org.apache.geronimo.kernel.config.MultiParentClassLoader@0x2aaab2e9b2e0 (156 bytes) (field parents:) exclude
      --> [Ljava.lang.ClassLoader;@0x2aaab0b97958 (88 bytes) (Element 1 of [Ljava.lang.ClassLoader;@0x2aaab0b97958:) exclude
      --> org.apache.geronimo.kernel.config.ChildrenConfigurationClassLoader@0x2aaab05e8bc0 (115 bytes) (field parent:) exclude
      --> org.apache.geronimo.kernel.config.MultiParentClassLoader@0x2aaab2e9b230 (156 bytes) exclude 
      

      It looks to me like the TomcatJAASRealm (its name is "DefaultJAASRealm") is a standard realm that is used by all WARs without explicit configuration. Setting the realm of a GeronimoStandardContext makes the context store a reference to its realm AND makes the realm store a reference to the context (see org.apache.catalina.core.ContainerBase#setRealm() which GeronimoStandardContext inherits). Thus, the default realm's reference is always directed to the context of the WAR deployed most recently. This reference keeps the context from being GCed even if the corresponding WAR has been undeployed in the meantime.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        91d 16h 32m 1 Ivan 22/May/09 03:25
        Resolved Resolved Closed Closed
        314d 23h 10m 1 Rex Wang 02/Apr/10 02:36
        Rex Wang made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Rex Wang added a comment -

        closing it

        Show
        Rex Wang added a comment - closing it
        Ivan made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.1.5 [ 12313729 ]
        Resolution Fixed [ 1 ]
        Hide
        Ivan added a comment -

        Commit changes to trunk at revision: 777350, 2.1.5 snapshot at revision: 777354

        Show
        Ivan added a comment - Commit changes to trunk at revision: 777350, 2.1.5 snapshot at revision: 777354
        Hide
        Ivan added a comment -

        Seems that ContainerBase.getRealm() method will automatically delegate the request to its parent if no realm is found in its own scope, so we may not need to explicitly set the default realm for the context if we do not find any realm setting for the application itself.

        Show
        Ivan added a comment - Seems that ContainerBase.getRealm() method will automatically delegate the request to its parent if no realm is found in its own scope, so we may not need to explicitly set the default realm for the context if we do not find any realm setting for the application itself.
        Ivan made changes -
        Assignee Ivan [ xuhaihong ]
        Donald Woods made changes -
        Field Original Value New Value
        Component/s Tomcat [ 11397 ]
        Component/s security [ 11143 ]
        Component/s Memory Leaks [ 12310624 ]
        Fix Version/s 2.2 [ 12312965 ]
        Priority Major [ 3 ] Blocker [ 1 ]
        Janko Heilgeist created issue -

          People

          • Assignee:
            Ivan
            Reporter:
            Janko Heilgeist
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development