Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.7.1
-
Fix Version/s: 1.8RC1
-
Component/s: ICE-Components
-
Labels:None
-
Environment:Facelets and a variety of webservers
-
Support Case References:
Description
Customer has a large Facelets based application based around a single large interface page with a large number of Panel components and UI:include tags. The nature of the application is slightly different from the facelets component-showcase application such that it is possible to detect in component-showcase, but isn't of the same magnitude.
Long term use of the application finds memory accumulating in a HashMap, owned by DefaultFaceletFactory, referenced by D2DFaceletsViewHandler. When the user logs out, not all of the memory is released by this class.
Long term use of the application finds memory accumulating in a HashMap, owned by DefaultFaceletFactory, referenced by D2DFaceletsViewHandler. When the user logs out, not all of the memory is released by this class.
Issue Links
- blocks
-
ICE-3083 Memory performance/efficiency
- Open
From Mark C. message #1
I remember reading about this on the Facelets mailing list. Basically, DefaultFaceletFactory, which extends FaceletFactory, does all of the parsing of the .xhtml files into Facelet objects, and also caches them. But there's no actual limit on the cache. The good news is that it's bounded by the number of .xhtml files, so it won't leak forever, unless they're auto-generating .xhtml files.
Here's my message, quoting the original one:
https://facelets.dev.java.net/servlets/ReadMsg?list=users&msgNo=8882
And here's the bugzilla entry someone made for it:
https://facelets.dev.java.net/issues/show_bug.cgi?id=260
And more importantly, From Mark message #2
The [D2D]FaceletViewHandler owns the DefaultFaceletFactory, so all users would be sharing the same cache of Facelet objects, since I believe all requests in an application share the same ViewHandler.
But, what could explain the continuous leaking of HashMap entry objects, is if the Facelet refreshing is enabled. That's a mechanism typically used in development for rapid application development, and also in production to allow for changing content without having to restart the application. If it has a value of -1, then refreshing is disabled, and content is static, otherwise it's the number of seconds that a Facelet will be reused for, before reparsing it from the .xhtml file. The default value is 2. And 0 would effectively mean to always reparse. Small values like 2 are useful for debugging, but not production. Have them try -1, to see if the problem goes away. Afterwards they can tune it to whatever they like, if they want to be able to update pages on the go.
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
</context-param>