You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/06/02 02:18:07 UTC

[GitHub] [arrow] liyafan82 commented on a change in pull request #10423: ARROW-12907: [Java] Fix memory leak on deserialization errors

liyafan82 commented on a change in pull request #10423:
URL: https://github.com/apache/arrow/pull/10423#discussion_r643604065



##########
File path: java/vector/src/main/java/org/apache/arrow/vector/ipc/message/MessageSerializer.java
##########
@@ -723,8 +723,13 @@ public static MessageMetadataResult readMessage(ReadChannel in) throws IOExcepti
   public static ArrowBuf readMessageBody(ReadChannel in, long bodyLength,
       BufferAllocator allocator) throws IOException {
     ArrowBuf bodyBuffer = allocator.buffer(bodyLength);

Review comment:
       Nice catch!
   A more conventional way is to wrap the statements in try-with-resource block?




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org