[JAVA-2460] Memory leaks when using NettyStream and CommandListener Created: 03/Mar/17 Updated: 14/Sep/23 Resolved: 28/Apr/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Async |
| Affects Version/s: | 3.4.2 |
| Fix Version/s: | 3.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sergey Polovko | Assignee: | Ross Lawley |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
I found some strange behaviour when NettyStream is used in async driver with a CommandListener configured. See next code example: https://gist.github.com/jamel/957aab95a8385ef43768f378fb405d25 There I enabled high level of Netty resource leak detector to see any problems with resource leakage. When line
After playing with this bug a little bit I found that root cause of these leaks is ByteBufBsonDocument class. When instance of this class is created it takes ownership of given buffer (because bsonOutput.getByteBuffers() increments reference counter in each returning sub buffer). Unfortunately ByteBufBsonDocument class never releases its buffer and currently there is no way to do that. |
| Comments |
| Comment by koji lin [ 23/Apr/18 ] |
|
ok, I created |
| Comment by Jeffrey Yemin [ 23/Apr/18 ] |
|
Hi, kojilin can you open up a new bug for the issue you're seeing? Thanks, |
| Comment by koji lin [ 23/Apr/18 ] |
|
Hi I met this problem even upgrade to 3.6.3 |
| Comment by Githook User [ 28/Apr/17 ] |
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Ensure that the ByteBufferBsonOutput releases all on close
|
| Comment by Ross Lawley [ 26/Apr/17 ] |
| Comment by Ross Lawley [ 25/Apr/17 ] |
|
Hi jamel, Thank you for the ticket and gist that reproduces the error, also apologies for the lack of response. Rest assured this issue is on our radar and we'll update once we have determined a suitable fix. Ross |