The Artima Developer Community
Sponsored Link

Java Answers Forum
WebappClassLoader not unloaded after webapp reload (Tomcat 4.1.24)

1 reply on 1 page. Most recent reply: Jan 27, 2004 8:48 AM by Lynn Hollerman

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Tatjana Apine

Posts: 1
Nickname: tatjana
Registered: Jan, 2004

WebappClassLoader not unloaded after webapp reload (Tomcat 4.1.24) Posted: Jan 27, 2004 8:30 AM
Reply to this message Reply
Advertisement
Hi all,

I'm having the following problem - my application is using Struts(1.1) and Log4J (1.2.7). I run it on tomcat 4.1.24.
I use OptimizeIt (www.optimizeit.com) to see what classes weren't garbage collected after I stop or reload my webapplication. I was experiencing memory leaks (but only if I was reloading my webapplication) and tried to investigate further.

I noticed that org.apache.catalina.loader.WebappClassLoader is not removed after I stop/reload my webapplication. Every time I restart my application, the new WebappClassLoader is added to the list
of WebappClassLoaders - and they are never get garbage collected.

I debugged this class and the class that is referencing this class loader (org.apache.catalina.loader.WebappLoader) and it looks like all references to this class from the WebappLoader are removed (WebappClassLoaders are stroed in the HashTable in the WebappLoader and when WebappClassLoader is not needed anymore, it's removed from the HashTable).
OptimizeIt is showing that "Jakarta Tomcat" is referencing this class, and does not give any details - so I cannot go further than that here.

I created a simple application that consists of 3 servlets
1) HttpServlet- no Log4J, no Struts
2) HttpServlet, Log4J, no Struts
3) Strut's ActionServlet, no Log4J.

For the first one everything works fine - WebappClassLoader is removed after webapplication is stopped.
I noticed, that calling the second and the third one I do not always get my WebappClassLoader classes in the list garbage collected instantly, but they disappear after some time (like 15-20 seconds after reloading the webapplication). In my "real" application they do not disappear at all...

I will appreciate any hints on this problem.


Lynn Hollerman

Posts: 67
Nickname: gmholler
Registered: Mar, 2002

Re: WebappClassLoader not unloaded after webapp reload (Tomcat 4.1.24) Posted: Jan 27, 2004 8:48 AM
Reply to this message Reply
You might want to search the archives of the Tomcat User's list for this - there's a link to them at http://tomcatfaq.sourceforge.net; I think this problem has been covered there in the past.

Lynn.

Flat View: This topic has 1 reply on 1 page
Topic: question on  StreamTokenizer  class Previous Topic   Next Topic Topic: What would you do?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use