Using The UseBean Tag
Thursday, December 13th, 2007JSPs generally use the <jsp:useBean> tag to provide themselves with access to beans in various scopes, such as:
<jsp:useBean id="someResult" scope="session" class="com...SearchResult" />
This tag is particularly expensive when the bean in question does not exist in the referenced scope. In this case the Beans framework goes off looking for a serialized bean on the classpath before eventually instantiating a new object through reflection. For each bean instantiated in this way there is ~100KB of memory cycled.
Optimization options:
1) Use a scriptlet to grab a reference from the request and/or session, check for the presence of the bean, and instantiate manually if required.
2) Always ensure the referenced objects are present in scope. Risky, but if you are a devoted JSTL user, then you must track your references from page to page.



