zymap commented on code in PR #4135:
URL: https://github.com/apache/bookkeeper/pull/4135#discussion_r1410094960


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/directentrylogger/DirectEntryLogger.java:
##########
@@ -262,6 +263,7 @@ private ByteBuf internalReadEntry(long ledgerId, long 
entryId, long location, bo
             
stats.getReadEntryStats().registerSuccessfulEvent(System.nanoTime() - start, 
TimeUnit.NANOSECONDS);
             return buf;
         } catch (EOFException eof) {
+            ReferenceCountUtil.release(buf);

Review Comment:
   How about releasing it in the finally block? We can avoid memory leaks on 
some uncatched exceptions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to