Issue Details (XML | Word | Printable)

Key: NUCHBASE-76
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: No Testcase No Testcase
Assignee: Unassigned
Reporter: Yevgeny Shakhnovich
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store HBase

Memory leak in HBaseManagedConnection

Created: 31/Jul/12 09:44 PM   Updated: 27/Sep/12 04:01 PM   Resolved: 13/Aug/12 08:51 PM
Component/s: None
Affects Version/s: 3.1.0.m3
Fix Version/s: None

File Attachments: 1. Text File patch.txt (0.4 kB)

Environment: Linux, HBase, etc

Datastore: HBase
Severity: Development


 Description  « Hide
Each time when we begin transaction, HBase allocates a ManagedConnection (from internal pool) and adds to it a new ManagedConnectionResourceListener, but it never removes it.
IMO, the best place to remove the listener would be HbaseManagedConnection.close()

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 02/Aug/12 08:49 PM
So attach a patch to SVN trunk

Yevgeny Shakhnovich added a comment - 07/Aug/12 12:42 AM
I tried to attach the patch to SVN tree but failed. This is the patch to fix the problem.

Andy Jefferson added a comment - 13/Aug/12 12:28 PM
Since the HBase plugin doesn't add any listener it doesn't seem to me to be the best place to remove it. Why not try with current nightly builds and see whether you observe this, since you don't say where the listener is added.

Yevgeny Shakhnovich added a comment - 13/Aug/12 07:52 PM
Listeners are added in org.datanucleus.store.connection.ConnectionManagerImpl.allocateConnection(line 226) because for HBase connectionPoolEnabled is set to false.

The stack is below:
org.datanucleus.store.connection.AbstractManagedConnection.addListener(ManagedConnectionResourceListener)
org.datanucleus.store.connection.ConnectionManagerImpl.configureManagedConnectionListener(Object, ManagedConnection, ConnectionFactory)
org.datanucleus.store.connection.ConnectionManagerImpl.allocateConnection(ConnectionFactory, Object, Transaction, Map)
org.datanucleus.store.connection.AbstractConnectionFactory.getConnection(Object, Transaction, Map)

Therefore, each time we get connection, we add a listener.

I tried the fix - it works.

Andy Jefferson added a comment - 13/Aug/12 08:51 PM
Nothing to do here (datanucleus-hbase) since this is in datanucleus-core.