Java heap retention in oracle.jdbc.driver.T4CXAResource$XidListEntry
Issue
- Heap dump analysis shows significant memory retained by
InternalManagedConnectionPoolwhere each managed connection has an associatedTxConnectionListenerwhich retains anOracleXAResourcewhich, in turn, owns aHashtableof transaction identifiers where each entry contains:- key:
org.jboss.jca.core.tx.jbossts.XidWrapperImpl - value:
oracle.jdbc.xa.OracleXAResource$XidListEntry
- key:
Class Name | Retained Heap | Shallow Heap | Percentage
-----------------------------------------------------------------------------------------------------------------------------------------
|- org.jboss.jca.core.connectionmanager.listener.TxConnectionListener @ 0x769449578 | 38,931,808 | 80 | 1.75%
| |- org.jboss.jca.adapters.jdbc.xa.XAManagedConnection @ 0x7694495c8 | 38,931,104 | 80 | 1.75%
| | |- oracle.jdbc.xa.client.OracleXAResource @ 0x76941b1d0 | 38,633,848 | 64 | 1.73%
| | | |- java.util.Hashtable @ 0x768fcb888 | 38,633,640 | 56 | 1.73%
| | | | '- java.util.Hashtable$Entry[417791] @ 0x7ca2e5898 | 38,633,584 | 1,671,184 | 1.73%
| | | | |- java.util.Hashtable$Entry @ 0x7b4d6ebf8 | 128,000 | 32 | 0.01%
| | | | | | ...
| | | | | |- org.jboss.jca.core.tx.jbossts.XidWrapperImpl @ 0x7dcdaeae8 | 144 | 40 | 0.00%
| | | | | |- oracle.jdbc.xa.OracleXAResource$XidListEntry @ 0x7db342560 | 24 | 24 | 0.00%
-----------------------------------------------------------------------------------------------------------------------------------------
- In some cases, it is observed that there are thousands of distinct entries containing unique global/branch transaction ID pairs for transactions which have completed hours or days prior to collection of the heap dump (i.e. these persist indefinitely)
- Individually, the
Xidinstances retain little memory but the accumulation over time (rate of accumulation varies with application/load) becomes significant
- Individually, the
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
- Verified in EAP 6 but may similarly impact older EAP releases
- Oracle JDBC driver
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.