tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: URL Import Question
Date Tue, 29 Apr 2008 14:05:52 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen,

Stephen Caine wrote:
| We are using a c:import url tag.  Under most circumstances this works
| just fine, but when it is iterated hundreds of times within the same
| page, it causes the java process to quickly exhaust threads.

That is a /lot/ of c:imports. Why do you need hundreds of c:imports in
the same page? That suggests to me that your architecture is not
particularly efficient.

I would imagine you are using mostly local imports. The JSTL spec says
that for internal resources, RequestDispatcher.include should be used.
If you are seeing an explosion of threads, then there is either a bug in
the JSTL implementation or you are observing unrelated behavior. The
servlet spec states that a request will be handled by a single thread
from start to finish -- that includes (ha!) includes. I'm pretty sure
that Tomcat will not allocate another thread to handle an include, so I
wonder if the JSTL is making a bad decision.

Are you using only local imports? Whose JSTL implementation are you
using, and what version?

If you are using external imports, you may have a problem. The JSTL spec
states that URLConnection should be used to fetch those resources.
URLConnection uses InputStream and OutputStream to handle input and
output. IIRC, each stream requires a thread, which means that all your
connections are creating lots of threads to manage input and output.
Since everything is still in scope (one giant _service method in your
JSP), the resources aren't cleaned up as the page executes.

In this case, I wonder if splitting a large page into smaller pages
might allow these resources to be freed a little more progressively.

Let's see what that thread dump shows...

- -chris

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

iEYEARECAAYFAkgXK0AACgkQ9CaO5/Lv0PCbwwCgvz38DJgs3U9NNjq2yQpfNOaa
b0MAoJnS4hBfStGbpj6aqBJNDUAZi38n
=vTRQ
-----END PGP SIGNATURE-----

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


Mime
View raw message