tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@apache.org>
Subject Re: WebappClassLoader getURL vs. Performance Problems
Date Wed, 10 Dec 2003 23:40:54 GMT
Marco Muishout wrote:
> Hi,
> 
> We are using a web application running in Tomcat 4.1.24 (JDK 1.3.1), on
> HP-UX. This web application uses an rmi server to connect to oracle. We
> experience serious performance problems when we are using this application
> in this mode. It seems that tomcat is very busy. We used profiling to
> analyze what Tomcat is doing.
> 
> It seems that Tomcat spends about 50% of its time in the following method:
> 
> org.apache.catalina.loader.WebappClassLoader.getURL()
> 
> The profiler shows us that this method is called only 4 times!
> 
> Does anyone have an explanation why this method consumes so much time? We
> had a look in the source code and we saw this:
> 
>     protected URL getURL(File file)
>         throws MalformedURLException
>     {
>         File realFile = file;
>         try
>         {
>             realFile = realFile.getCanonicalFile();
>         }
>         catch(IOException e) { }
>         return realFile.toURL();
>     }
> 
> 
> Could it be that we have an IOException? Why is this exception ignored?
> 
> Feedback is highly appreciated..!

I think I know (are you really sure about the invocation count ? this 
looks very suspicious). If getURLs() is called all the time (I think RMI 
uses that), then getURL will get called a lot (and getCanonicalFile is 
very expensive). The URL array needs to be cached (you should try to 
patch your Tomcat).

Rémy



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message