Search code examples
javanettynio

Is buf leaks ok while using `UnpooledByteBufAllocator`


I am using netty 4.1's UnpooledByteBufAllocator and have some bufs created by it that will not be released.

Will this be dangerous ?


Solution

  • In theory yes as the GC will take care to collect the memory at some point. That said it is definitely better and safer to not have any leaks. This also will help you later on once you decided you want to use the PooledByteBufAllocator.