JBoss EAP has heap growth in com.sun.org.apache.xerces.internal.dom.DocumentImpl from CXF WebService processing after upgrading to EAP 8

Solution Verified - Updated

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.DocumentImpl object's nodeUserData map 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.TextImpl objects 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

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.