Memory leak in org.apache.taglibs.standard.lang.jstl.ELEvaluator

Solution Verified - Updated

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x

Issue

  • A heap dump shows a memory leak in class org.apache.taglibs.standard.lang.jstl.ELEvaluator's sCachedExpressionStrings map.

Resolution

  • Upgrade to EAP 6.3.0+ to acquire the fix
  • Use the following This content is not included.one-off patch for EAP 5.1.1
  • A workaround is to implement some code that clears all the ELEvaluator cache related objects when executed:
((java.util.Map)com.util.reflect.ReflectUtil.getStaticField(org.apache.taglibs.standard.lang.jstl.ELEvaluator.class,"sCachedExpressionStrings")).clear();

Root Cause

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.