You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am aware that it is best practice to release() locally created buffers in a finally block.
However, is this strictly necessary for unpooled heap buffers (i.e., buffers obtained via Unpooled.buffer())?
My understanding is that unpooled heap buffers are entirely allocated on the Java heap, and their lifecycle is managed by the garbage collector, but I could be wrong on this.
BTW, this question is similar to #8139 but regarding a different type of buffer.
The text was updated successfully, but these errors were encountered:
@ran-su generally speaking no... that said by default we will still report it as leak to make it easier for people to switch between allocators. Even if the GC manage the unpooled buffers we will ensure to give the direct memory back in a fast fashion when calling release. So all in all it is preferred to do so.
I am aware that it is best practice to
release()
locally created buffers in afinally
block.However, is this strictly necessary for unpooled heap buffers (i.e., buffers obtained via
Unpooled.buffer()
)?My understanding is that unpooled heap buffers are entirely allocated on the Java heap, and their lifecycle is managed by the garbage collector, but I could be wrong on this.
BTW, this question is similar to #8139 but regarding a different type of buffer.
The text was updated successfully, but these errors were encountered: