Working with buffer pool in MongoClient Java

Hi @Anton_Konovalov1,

Usage of PowerOfTwoBufferPool can currently be controlled via StreamFactoryFactory which may be specified via MongoClientSettings.Builder.streamFactoryFactory. The only implementation of StreamFactoryFactory provided by the driver that does not use PowerOfTwoBufferPool and supports configuring the allocation policy for byte buffers is NettyStreamFactoryFactory. It uses io.netty.buffer.ByteBufAllocator.DEFAULT by default, and allows setting a different allocator via NettyStreamFactoryFactory.Builder.allocator.

1 Like