1

We found that the system is frequently running out of memory, running Full GC did not help to reclaim the memory. We then take a heap dump an analyse the contents.

JSF implementation name/version Mojarra 2.1.28-jbossorg-2 Server name/version : JBoss EAP 6.3

We found some HTTP sessions are holding more than 2GB of memory. A screen dump of the dominator_tree from the MAT is attached in the following link

https://drive.google.com/file/d/1zX1xHzpXBacrDuSNrS2Dp1kVUDm00uku/view?usp=sharing

It shows that there are many org.primefaces.component.tabview.TabView components (about 360 of them) , each referring to 5M to 9M of memory and refers to a particular set of UI in the system !

I raised a question in the primefaces forum and it is suggested that the problem may be related to JSF bindings.

I checked with the source of the page and it contains:

    <f:actionListener binding="#{CourseInfoManagedBean.initBatchUpload()}"/>

where CourseInfoManagedBean is a @ViewScoped bean.

Will that cause memory leak ?

Moreover, why those org.primefaces.component.tabview.TabView UI components are created directly under the org.apache.catalina.session.StandardSession rather than under the com.sun.faces.util.LRUMap ?

Selaron
  • 5,617
  • 4
  • 26
  • 38
William
  • 11
  • 2
  • Why do you use an `f:actionListener` with a binding? What is the usecase? – Kukeltje Nov 07 '19 at 08:50
  • 2
    Do you possibly instantiate TabViews dynamicalle from within a bean and store them in view or session scope? – Selaron Nov 07 '19 at 09:10
  • And please try an [mcve] in a more recent JSF version – Kukeltje Nov 07 '19 at 09:11
  • 1
    In short btw, the answer to the 'leak' is sort of yes. The answer to the second question is either caused by something that is wrong in the existing code or a possible bug in jsf which might be solved in newer versions of mojarra or a lack of it in myfaces (like also mentioned in the primefaces forum and adding a link to this btw in your question is good practice) – Kukeltje Nov 07 '19 at 09:11
  • Binding a component to bean property will do that yes. The abovelinked duplicate clearly explains that. The `` does however not bind a component to a bean property. It only binds a bean action method to the parent component. So you need to search further for the real cause. – BalusC Nov 07 '19 at 09:34
  • Reply to Selaron, no, we do not instantiate TabViews dynamically and thus it is strange to find out them stored in the HTTP session directly. – William Nov 07 '19 at 10:23
  • 1
    In general But looking them up in a method, assigning them to a field that is in the session is also causing them to be stored. Every holding of a reference does – Kukeltje Nov 07 '19 at 15:00

0 Answers0