DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29274>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29274

WebAppClassLoader does not release loaded classes if webapp is reloaded

           Summary: WebAppClassLoader does not release loaded classes if
                    webapp is reloaded
           Product: Tomcat 5
           Version: 5.0.19
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


If a wepapp is reloaded using the Tomcat manager, memory occupied by reference 
type static members from the webapp's classes is not released.

Memory is only released if the webapp is undeployed.

I guess this is a problem of the WebAppClassLoader. A class itself is only 
unloaded by the JVM if it's classloader was finalized. If after a reload from 
the manager the webapp still uses the same classloader, old classes will not 
get unloaded and so their memory will never be freed resulting in 
OutOfMemoryError`s.

Sample code:

class SomeServlet extends HttpServlet {
static byte[] bigData = new byte[50000000];
        protected void service(HttpServletRequest arg0, HttpServletResponse 
arg1)
                        throws ServletException, IOException {
        }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to