Sorry, I don't know which version of Wildfly JBoss EAP 7.4.0 corresponds to.
We have custom tag handlers in JBoss 7.4.0 GA that throw exceptions during normal operation, and they result in a Java "memory leak" (which ultimately result in an OutOfMemoryError) due to being retained by the org.jboss.as.web.common.WebInjectionContainer variable named webInjectionContainer, of the org.wildfly.extension.undertow.deployment.UndertowJSPInstanceManager.
How can I prevent the JSP InstanceManager from holding on to this reference to the Tag?
I have tried setting tag-pooling to false,
-Dorg.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false, and
-Dorg.apache.jasper.Constants.USE_INSTANCE_MANAGER_FOR_TAGS=false,
but the reference remains.
GC root trace:
contextref of My.Tag (0x16b215)
keyRef of org.jboss.as.web.common.ConcurrentReferenceHashMap$HashEntry (0x16b214)
element of org.jboss.as.web.common.ConcurrentReferenceHashMap$HashEntry[ ] (0x1b3ad8)
table of org.jboss.as.web.common.ConcurrentReferenceHashMap$Segment (0x16b212)
element of org.jboss.as.web.common.ConcurrentReferenceHashMap$Segment[ ] (0x1a3592)
segments of org.jboss.as.web.common.ConcurrentReferenceHashMap (0x84914)
instanceMap of org.jboss.as.web.common.WebInjectionContainer (0x84913)
webInjectionContainer of org.wildfly.extension.undertow.deployment.UndertowJSPInstanceManager (0x84912)
The tags referred to here are custom tags that inherit from javax.servlet.jsp.tagext.BodyTagSupport.
This bug is not JBWEB-242 (a tag-pooling memory leak). It might be JBWEB-269 "Memory Leak when Custom Tags Throw Runtime Exception", but I cannot see the description of that report at
https://issues.jboss.org/browse/JBWEB-269 . The technical issue is that the JSP is compiled into Java code that does not use a finally clause to guarantee that the _jsp_instancemanager.destroyInstance() method is called when the tag's doStartTag() or other methods throw a javax.servlet.jsp.JspTagException or RuntimeException. (The finally clause should also be used to guarantee that the tag's release() method is called, but that is not the root of the problem here. It would be the root of a problem is tag pooling were in use.)