We've been using Netty as the MongoDB transport in our Java application and it's been working fine.
However, since upgrading to Netty 4.1, we began running into memory leaks.
The errors look like the following:
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.
By changing the transport back to the default NIO2, the leak is gone and everything works again.
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.
We're using the async driver 3.3.0 and RX driver 1.2.0 (though RX is probably unrelated to the problem).
- is duplicated by
-
JAVA-2157 Java driver stops connecting to one server after cluster status update
- Closed