[JCBC-16] client can OOM due to a bug in netty Created: 28/Feb/12  Updated: 05/Apr/12  Resolved: 05/Apr/12

Status: Closed
Project: Couchbase Java Client
Component/s: Core
Affects Version/s: 1.0.1
Fix Version/s: 1.0.2
Security Level: Public

Type: Bug Priority: Blocker
Reporter: Matt Ingenthron Assignee: Raghavan Srinivas (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File TapConnectionProvider.patch    

 Description   
According to the bug reporter, the client can OOM leaking vbucket objects, and those owing (likely) to a bug in Netty.

From the bug reporter:
Using sdk 1.0.1 and couchbase (enterprise) 1.8, my application
(basically a TapClient which runs "dump" method) had OutOfMemory and
"Too many open files" issues.
By dumping memory with jmap, it seemed that jvm memory was full of
VBucket object, also there was a correlation between the number of
VBucket and each tapclient.dump call (each calls brings like 2048 new
elements).

This is surely related to some changes in
spymemcached2.8+couchbase1.0.1 as I had no issue with spymemcached
2.7.3.
It seems that those VBucket where related to CouchbaseConnection
object, which were (at least) referenced in some org.jboss.netty
classes, like org.jboss.netty.channel.AbstractChannel.
I had no time to check in the Netty community, but it seems that
replacing sdk default netty jar with the latest 3.3.1 solves the
issue, as the number of
Vbucket is no longer running up.

Anyone facing the same issue? Is it safe to use this netty version?
Eventually, if this issue is confirmed, it could be time to update the
sdk zip file downloadable by the site.

 Comments   
Comment by Walter [ 01/Mar/12 ]
It seems it maybe connected to
https://issues.jboss.org/browse/NETTY-424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#issue-tabs
by the way, it also seems that TapConnectionProvider.java open a CouchbaseConnectionFactory but never shutdown it.
I'm going to add a patch of that file which at least until now, it seems to do the trick.
Comment by Walter [ 01/Mar/12 ]
this keeps the number of VBucket object under control.
Generated at Sat Aug 23 04:51:20 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.