JBoss EAP has heap growth in com.sun.org.apache.xerces.internal.dom.DocumentImpl from CXF WebService processing after upgrading to EAP 8
Environment
- JBoss Enterprise Application Platform (EAP) 8.x
Issue
- After upgrading from EAP 7 to EAP 8, we see large heap growth in a
com.sun.org.apache.xerces.internal.dom.DocumentImplobject'snodeUserDatamap after many CXF web service client calls:
Class Name | Shallow Heap | Retained Heap | Percentage
------------------------------------------------------------------------------------------------------------
com.sun.org.apache.xerces.internal.dom.DocumentImpl @ 0xe25d4778| 136 | 158,840,920 | 26.33%
'- nodeUserData java.util.HashMap @ 0xe25d4870 | 48 | 158,840,760 | 26.32%
'- table java.util.HashMap$Node[1048576] @ 0xfe700000 | 4,194,320 | 158,840,712 | 26.32%
- The heap growth in this map is from many
com.sun.org.apache.xerces.internal.dom.TextImplobjects with similar repeating string values:
Class Name | Objects | Shallow Heap | Retained Heap
----------------------------------------------------------------------------------------
com.sun.org.apache.xerces.internal.dom.TextImpl| 540,569 | 17,298,208 | >= 38,351,888
----------------------------------------------------------------------------------------
Resolution
- Removing annotations from the wsdl if possible can reduce the heap growth.
- Also, you should cache created service port objects when done with for future reuse for best performance. Avoiding repeated service port creations would avoid continued heap growth that results.
Root Cause
- This is affected by a change that eliminated webservices' dependency on xerces (This content is not included.JBEAP-25421) that was necessary to achieve the more important goal to eliminate xerces from EAP distribution (This content is not included.JBEAP-25904).
- So the JDK provided implementation is now used and then allows for the leak as it keeps adding the repeat com.sun.org.apache.xerces.internal.dom.TextImpl objects as they are never considered equal for the hashmap key checks. These text objects come from parsing and handling of annotiations in the wsdl used.
- This content is not included.JBWS-4445
- This content is not included.JBEAP-30028
- This content is not included.JBEAP-30105
SBR
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.