[JAVA-2302] Memory leak on Java async driver + Netty 4.1.x Created: 09/Sep/16 Updated: 19/Oct/16 Resolved: 19/Sep/16 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Async |
| Affects Version/s: | 3.3.0 |
| Fix Version/s: | 3.4.0-rc1, 3.4.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Frederico Ferro Schuh | Assignee: | Ross Lawley |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Java 8, Vert.x 3.3.2, CentOS Linux release 7.2.1511 (Core) |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
We've been using Netty as the MongoDB transport in our Java application and it's been working fine. com.mongodb.MongoException: failed to allocate 16777216 byte(s) of direct memory (used: 4596957223, max: 4608491520) It starts happening after doing lots of Mongo queries. We hope we can go back to using Netty though, as it performs better. The issue happened with both Netty 4.1.1 and 4.1.4. It seems related to Netty 4.1.x releases in general. |
| Comments |
| Comment by Frederico Ferro Schuh [ 20/Sep/16 ] |
|
Great news Ross. |
| Comment by Githook User [ 19/Sep/16 ] |
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Netty fixes Update Netty to 4.1.5.final
|
| Comment by Ross Lawley [ 16/Sep/16 ] |
|
Thanks fschuh, Your test program was instrumental in identifying a leak. Once the leak was fixed I was no longer able to hit your issue, I ran the test to 100k iterations. Ross |
| Comment by Ross Lawley [ 16/Sep/16 ] |
| Comment by Frederico Ferro Schuh [ 16/Sep/16 ] |
|
Hello Ross, sorry for not posting the whole stack trace before. Please set the max heap size as small as you can. Tested with Netty 4.1.1 Final. Heres what the stack trace looks like: Exception in thread "main" com.mongodb.MongoInternalException: Unexpected exception |
| Comment by Ross Lawley [ 15/Sep/16 ] |
|
Hi, I've been unable to reproduce this issue. Do you have a test case that causes it? Also a stacktrace might throw more light on the cause. Ross |
| Comment by Frederico Ferro Schuh [ 09/Sep/16 ] |
|
Thanks for the quick response Ross. |
| Comment by Ross Lawley [ 09/Sep/16 ] |
|
Hi fschuh, Thanks for the ticket, we currently test against netty 4.0.x. From what you describe it seems there is some behavioural changes in the 4.1.x series. I'll investigate and see if we can trigger the same error and determine a fix. Ross |