You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jake Fear (JIRA)" <ax...@ws.apache.org> on 2005/09/29 19:23:49 UTC

[jira] Created: (AXIS-2241) Session scoped services leak memory due to bug in the AxisHTTPSessionListener code.

Session scoped services leak memory due to bug in the AxisHTTPSessionListener code.
-----------------------------------------------------------------------------------

         Key: AXIS-2241
         URL: http://issues.apache.org/jira/browse/AXIS-2241
     Project: Apache Axis
        Type: Bug
  Components: Basic Architecture  
    Versions: 1.2.1    
 Environment: Linux and Windows for sure, would appear to affect all environments.
    Reporter: Jake Fear


The check for session destruction in the AxisHTTPSessionListener code is incorrect, looking for an impossible type in the session attribute names.  It is looking for a ServiceLifecycle object in the enumeation of names, which would not be allowed to be placed there by the session interface.  This causes a memory leak (more like a hemorage ;-) when services try to use session scope.

 Enumeration e = session.getAttributeNames();
        while (e.hasMoreElements()) {
            Object next = e.nextElement();
            if (next instanceof ServiceLifecycle) {
                ((ServiceLifecycle)next).destroy();
            }
        }

Should be something more like:

 Enumeration e = session.getAttributeNames();
        while (e.hasMoreElements()) {
            Object next = session.getAttribute(e.nextElement().toString());
            if (next instanceof ServiceLifecycle) {
                ((ServiceLifecycle)next).destroy();
            }
        }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira