We are having a high memory consumption on our app, we took a heap dump and mat analyzer is pointing two leak suspects.
The first one is "org.apache.catalina.session.StandardManager", so if we dig in we found that on every session JSF saves on the activeViewMap 23 views approx. and some of these views are retaining 23MB.
The second leak suspect is 201 instances of "org.apache.tomcat.util.threads.TaskThread" that are retaining 1GB of memory, on each of these most of the objects are jsf components.
Also when this heap dump was taken, the GC executed for a long time:
- Is it normal that JSF is consuming that much memory? How can I reduce memory consumption?
- I'm using a lot of custom tags and a lot of EL conditional expressions in these, could this be a problem?
- Is it a good idea to reduce active views to the minimum? I already tried setting com.sun.faces.numberOfLogicalViews and com.sun.faces.numberOfViewsInSession to 6 instead of the default 15
- Which is the correct way to use viewscoped beans? Is it correct to use for a datatable of results or should I use requestscoped?