tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: very slow class loading on initial JSP/servlet request after restart
Date Fri, 20 Feb 2009 18:03:39 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sam,

On 2/20/2009 12:11 PM, Sam Hokin wrote:
> jstack.0.txt ran BEFORE my test request.

Your server is completely idle, here.

> jstack.1-11.txt ran DURING the long wait.

Observing jstack.1.txt, it looks like this is the only running thread
(complete stack trace shown just for this first one):

Thread 9994: (state = IN_NATIVE)
 - java.io.UnixFileSystem.getBooleanAttributes0(java.io.File) @bci=0
(Compiled frame; information may be imprecise)
 - java.io.UnixFileSystem.getBooleanAttributes(java.io.File) @bci=2,
line=228 (Compiled frame)
 - java.io.File.exists() @bci=20, line=733 (Compiled frame)
 - sun.misc.URLClassPath$FileLoader.getResource(java.lang.String,
boolean) @bci=136, line=995 (Compiled frame)
 - sun.misc.URLClassPath$FileLoader.findResource(java.lang.String,
boolean) @bci=3, line=962 (Compiled frame)
 - sun.misc.URLClassPath.findResource(java.lang.String, boolean)
@bci=17, line=145 (Compiled frame)
 - java.net.URLClassLoader$2.run() @bci=12, line=362 (Compiled frame)
 -
java.security.AccessController.doPrivileged(java.security.PrivilegedAction,
java.security.AccessControlContext) @bci=0 (Interpreted frame)
 - java.net.URLClassLoader.findResource(java.lang.String) @bci=13,
line=359 (Compiled frame)
 - java.lang.ClassLoader.getResource(java.lang.String) @bci=30, line=978
(Compiled frame)
 - java.lang.ClassLoader.getResource(java.lang.String) @bci=12, line=973
(Compiled frame)
 - java.lang.ClassLoader.getResourceAsStream(java.lang.String) @bci=2,
line=1168 (Interpreted frame)
 -
org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(java.lang.String)
@bci=326, line=1205 (Interpreted frame)
 -
org.apache.jasper.servlet.JasperLoader.getResourceAsStream(java.lang.String)
@bci=5, line=144 (Interpreted frame)
 - org.apache.jasper.compiler.JDTCompiler$1.findType(java.lang.String)
@bci=89, line=193 (Compiled frame)
 - org.apache.jasper.compiler.JDTCompiler$1.findType(char[], char[][])
@bci=124, line=178 (Compiled frame)
 -
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(org.eclipse.jdt.internal.compiler.lookup.PackageBinding,
char[]) @bci=27, line=122 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getType(char[])
@bci=16, line=126 (Interpreted frame)
 - org.eclipse.jdt.internal.compiler.lookup.Scope.findType(char[],
org.eclipse.jdt.internal.compiler.lookup.PackageBinding,
org.eclipse.jdt.internal.compiler.lookup.PackageBinding) @bci=14,
line=1351 (Compiled frame)
 -
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(char[],
int) @bci=1017, line=2408 (Compiled frame)
 - org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(char[][])
@bci=14, line=2090 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(org.eclipse.jdt.internal.compiler.lookup.Scope)
@bci=17, line=69 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(org.eclipse.jdt.internal.compiler.lookup.ClassScope)
@bci=36, line=163 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(org.eclipse.jdt.internal.compiler.lookup.ClassScope)
@bci=2, line=114 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(org.eclipse.jdt.internal.compiler.ast.TypeReference)
@bci=35, line=1121 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass()
@bci=157, line=835 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy()
@bci=34, line=960 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy()
@bci=20, line=290 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings()
@bci=72, line=218 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(org.eclipse.jdt.internal.compiler.env.ICompilationUnit[],
int) @bci=198, line=603 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(org.eclipse.jdt.internal.compiler.env.ICompilationUnit[])
@bci=19, line=357 (Interpreted frame)
 -
org.eclipse.jdt.internal.compiler.Compiler.compile(org.eclipse.jdt.internal.compiler.env.ICompilationUnit[])
@bci=6, line=371 (Interpreted frame)
 -
org.apache.jasper.compiler.JDTCompiler.generateClass(java.lang.String[])
@bci=837, line=413 (Interpreted frame)
 - org.apache.jasper.compiler.Compiler.compile(boolean, boolean)
@bci=30, line=317 (Interpreted frame)
 - org.apache.jasper.compiler.Compiler.compile(boolean) @bci=3, line=295
(Interpreted frame)
 - org.apache.jasper.compiler.Compiler.compile() @bci=2, line=282
(Interpreted frame)
 - org.apache.jasper.JspCompilationContext.compile() @bci=31, line=586
(Interpreted frame)
 -
org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, boolean) @bci=118, line=317
(Interpreted frame)
 -
org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean) @bci=193, line=342 (Interpreted frame)
 -
org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) @bci=436, line=267 (Interpreted
frame)
 - javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) @bci=30, line=717 (Interpreted frame)
 -
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) @bci=374, line=290 (Interpreted frame)
 -
org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) @bci=101, line=206 (Interpreted frame)
 -
org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=804, line=233 (Interpreted
frame)
 -
org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=365, line=191 (Interpreted
frame)
 -
org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=64, line=128 (Interpreted
frame)
 -
org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=6, line=102 (Interpreted frame)
 -
org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=42, line=109 (Interpreted
frame)
 -
org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request,
org.apache.coyote.Response) @bci=157, line=286 (Interpreted frame)
 - org.apache.coyote.ajp.AjpAprProcessor.process(long) @bci=309,
line=419 (Compiled frame)
 -
org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(long)
@bci=39, line=378 (Interpreted frame)
 - org.apache.tomcat.util.net.AprEndpoint$Worker.run() @bci=147,
line=1509 (Interpreted frame)
 - java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)


jstack.2.txt has the same stack trace:

 - java.io.UnixFileSystem.getBooleanAttributes0(java.io.File) @bci=0
(Compiled frame; information may be imprecise)
 - java.io.UnixFileSystem.getBooleanAttributes(java.io.File) @bci=2,
line=228 (Compiled frame)
 - java.io.File.exists() @bci=20, line=733 (Compiled frame)
 - sun.misc.URLClassPath$FileLoader.getResource(java.lang.String,
boolean) @bci=136, line=995 (Compiled frame)
 - sun.misc.URLClassPath$FileLoader.findResource(java.lang.String,
boolean) @bci=3, line=962 (Compiled frame)
 - sun.misc.URLClassPath.findResource(java.lang.String, boolean)
@bci=17, line=145 (Compiled frame)

jstack.8.txt is the last thread dump where File.exists was stalled.

> http://ims.net/jstack/jstack.9.txt
> http://ims.net/jstack/jstack.10.txt
> http://ims.net/jstack/jstack.11.txt

The server appears to be idle, here.

It's a little weird that thread 9770 has NO STACK INFO AT ALL.

> http://ims.net/jstack/jstack.12.txt
> http://ims.net/jstack/jstack.13.txt

Also idle.

> I wish I could divine something informative from these.  Perhaps one of
> you can.
> 
> I'm also trying to use Wireshark to see if there is some specific net
> activity that's going on during the long wait, as suggested by David Smith.

Obviously, the File.exists method shouldn't be taking that long... it's
a pretty simple operation. Are you using an NFS or other network share?
Does your disk have any physical problems? Is this machine running next
to any equipment that generates a lot of stray alpha particles? :)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkme8HsACgkQ9CaO5/Lv0PB6NACgp5TaO3shV+t2Z/Bjd7a/ZWYP
H0EAn2Y6A8xHEgDA1d4v+QgkJxUADLU6
=NEQl
-----END PGP SIGNATURE-----

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


Mime
View raw message