JBoss - Java heap retention in WrapperDataSourceService's 'connectionMap' HashMap

Solution Verified - Updated

Environment

  • JBoss Enterprise Application Platform (EAP) 4.3.0_CP07 and earlier

Issue

  • We received a "java.lang.OutOfMemoryError: Java heap space"
  • The heap is consumed in a RMI TCP Connection thread by org.jboss.resource.adapter.jdbc.local.LocalManagedConnection objects stored in the 'connectionMap' java.util.HashMap of a org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService

Resolution

  • This HashMap usage ultimately stems from remote datasource access.  Remote access is not recommended due to many performance concerns.  The best option would be to remove
    <use-java-context>false</use-java-context>
    
    from all datasources and access them through the "java:/" context.
  • Ensure all datasource connections obtained are properly closed
  • A bug prevented proper removal from this HashMap with connection closes. Upgrade to 4.3.0_CP08 or later where this bug is fixed and the connections are properly removed from this map.

Root Cause

Diagnostic Steps

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.