Bug 1128288

Summary: Memory leak in AutoConnectionCloser
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jamie Beznoski <jamie.beznoski>
Component: RemotingAssignee: David M. Lloyd <david.lloyd>
Status: CLOSED NOTABUG QA Contact: Jitka Kozana <jkudrnac>
Severity: high Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.2.0CC: csutherl, jamie.beznoski, lthon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-10 12:53:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jamie Beznoski 2014-08-08 19:43:36 UTC
Description of problem:

AutoConnectionCloser class in the ejb remoting API keeps a cache of all remoting connections.  These objects are not deleted until the JVM shuts down (this class has a JVM shutdown hook).  This causes a memory leak for client applications: particularly multi-threaded ones - in our case, we create a connection for each EJB invocation, which adds up quickly over time.

Version-Release number of selected component (if applicable):

Tested on JBoss EAP 6.2 (module is jboss-ejb-client-1.0.24.Final-redhat-1)

How reproducible:

Create a remoting client as described here:
https://docs.jboss.org/author/display/AS72/Scoped+EJB+client+contexts

In our case, our client is multi-user/multi-threaded.  In high-concurrency/high-throughput test runs, we encounter OutOfMemoryErrors that can be traced back to the org.jboss.remoting3.ConnectionImpl object, which is cached in AutoConnectionCloser

Actual results:

Memory leak of approx. 2k per connection

Expected results:

An option to disable caching would be great!

Additional info:

Comment 1 Ladislav Thon 2014-09-10 12:05:12 UTC
Is this still valid? The customer case is already closed and indicates that this issue was solved by upgrading to a newer version of the EJB client (1.0.25).

Comment 2 Jamie Beznoski 2014-09-10 12:53:52 UTC
That is correct - issue was resolved by upgrading to 1.0.25.

Bug can be closed.

Comment 3 Ladislav Thon 2014-09-10 13:12:55 UTC
Thank you!