I'm currently facing some memory issues - mostly noticable with the firefox browser (version 13.x) but also in IE and chrome (but there not so grave).
So I tried to narrow it down and took measurements with the google chrome developer tool (timeline and heap snapshotting)....
Simple rerendering of plain jsf 1.2 and most of the rf 3.3.3 components is no problem at all. The DOM Node Count increases and also the number of event listeners, but the garbage collection is good enough to clean it up. So no memory leak here.
(h:outputText, h:inputText, h:inputTextarea, h:selectOneMenu.... rich:dataTable...)
But then I tried the same approach with a rich:tree (and rich:recursiveTreeNodesAdaptor), rich:editor, rich:suggestionBox and rich:extendedDataTable: after rerendering there seem to be a increased number of DOM nodes and Eventlisteners which the garbage collection could not clean up.
I'm also using a jQuery UI Multiselect which leaves a lot of "crap" even after properly destroying it.
To solve this, I tried this:
<a4j:queue onbeforedomupdate="cleanup(request.getResponseText());" />
so every time an ajax-request is almost done, I parse the responseText and look for the list of IDs do become rerendered. For every ID I look up the component in the DOM and try to remove all attached eventlisterns and for all children. I also call the proper "destroy" functions of the multiselect, inputspinner and the datepicker here.
This help, ..... a bit. It reduces the number of not removed eventlisteners by some factor.
But this is not enough....
In Richfaces.memory you can attach new "cleaner" listener which will be called then the rerendering on the client begins.
Is there some manual / documentation for this approach?
I only found a jquery and a prototype "cleaner".
I'll try to build an own cleaner which hopefully will cleanup the components created by jquery ui libraries...