Description
We have noticed that there is a memory leak in class org.apache.myfaces.renderkit.ErrorPageWriter, map: visitedFacetCount.
This memory leak occurs when <ui:debug/> is used.
Description of problem:
Ui debug component tree page use visitedFacetCount as a temporary source of UI components in order to generate html page based on such components.
This generator use visitor : ExtendedComponentTreeVisitCallback class.
Inside method visit we have following lines :
972: _incrementVisitedFacetCount(parent); //put compnent into visitedFacetCount map
...
1131: _removeVisitedFacetCount(parent); // remove visited component from visitedFacetCount map.
Unfortunatelly visited component is removed from visitedFacetCount map only if there are no children for component.
Thus it looks like components are never removed properly from visitedFacetCount.
Possible solution:
Parrent componet should be removed from visitedFacetCount when it back from recursion.