tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Large webapps in 7.0.29 and Annotation Scanning not respecting "metadata-complete"
Date Wed, 01 Aug 2012 07:51:04 GMT
On 01/08/2012 02:53, andreas palsson wrote:
> 
> Good morning.
> 
> After upgrading to 7.0.29, one of my larger webapps could no longer be deployed due to
"OutOfMemoryError".
> As far as I know, this is related to the new feature of annotation scanning which was
enabled in v7.0.29 (see the stack trace below).
> 
> Have anyone else experienced the same issue?

There are multiple issues going on here. There have been reported
previously and are understood. I'll try and explain the full story.

The servlet spec requires (and the expert group (EG) confirmed) that
Tomcat always scans for ServletContainerInitializers (SCIs), even if
metadata-complete is true. Tomcat was changed to do this in 7.0.29.

SCIs can have @HandlesTypes annotations. If one is present, Tomcat must
scan every class and its hierarchy looking for matches to the
HandlesTypes. Tomcat caches the results of this scan to speed up
processing so it doesn't repeatedly scan the same classes. If A & B both
inherit from C, when Tomcat scans A it also scans C and caches the
result so it doesn't have to scan C again when checking B. Tomcat was
caching more than it needed to making the cache excessively large. This
is bug 53535 which has already been fixed and will be in 7.0.30 onwards.

This then raises the question of how to turn of scanning for classes
that match HandlesTypes. While the spec says that JARs excluded using an
absolute-ordering are not scanned for matches to HandlesTypes it was
unclear what is meant to happen when metadata-complete is true since
ordering is ignored in that case.

The EG has recently clarified this and stated that JARs excluded using
an absolute-ordering are not scanned for matches to HandlesTypes
regardless of the setting of metadata-complete. The discussion is not
yet complete and we are waiting for it to conclude and before
implementing the results of that discussion in 7.0.30.

Mark


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


Mime
View raw message