XARecoveryModule leaks org.postgresql.jdbc4.Jdbc4Connection when using PostgreSQL as XA Datasource
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 5.x
- PostgresSQL
- XA Datasource
Issue
XARecoveryModuleleaksorg.postgresql.jdbc4.Jdbc4Connectionobject every(periodicRecoveryPeriod + recoveryBackoffPeriod)seconds when using PostgreSQL as XA Datasource<xa-datasource>
Resolution
The fix was included in EAP 5.2.0. Upgrade to the latest version of EAP 5.
Or you can apply one-off patches for this issue which are available from the followings:
- EAP 5.1.2: This content is not included.This content is not included.https://access.redhat.com/jbossnetwork/restricted/softwareDetail.html?softwareId=11773&product=appplatform&version=5.1.2&downloadType=patches
- EAP 5.1.1: This content is not included.This content is not included.https://access.redhat.com/jbossnetwork/restricted/softwareDetail.html?softwareId=10173&product=appplatform&version=5.1.1&downloadType=patches
Root Cause
- Content from issues.jboss.org is not included.Content from issues.jboss.org is not included.https://issues.jboss.org/browse/JBTM-924
XARecoveryModule._xidScans()can not reuseorg.postgresql.jdbc4.Jdbc4Connectionobject. SoJdbc4Connectionis created every(periodicRecoveryPeriod + recoveryBackoffPeriod)seconds. Because PostgreSQL does not implemetisValid()andisSameRM()and both methods always return false.
Diagnostic Steps
- Ask for heap dump (How do I create a Java heap dump?)
- Check
Jdbc4Connectionwith memory leak profiler. (How do I analyze a Java heap dump?)- The number of
Jdbc4Connectionobjects increase every(periodicRecoveryPeriod + recoveryBackoffPeriod)seconds and it is never deleted.
- The number of
Components
Category
Tags
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.