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 2022/05/04 23:53:09 UTC

[GitHub] [arrow] minyoung commented on a diff in pull request #13068: ARROW-16473: [Go] fixing memory leak in serializedPageReader

minyoung commented on code in PR #13068:
URL: https://github.com/apache/arrow/pull/13068#discussion_r865467660


##########
go/parquet/file/page_reader.go:
##########
@@ -611,8 +610,6 @@ func (p *serializedPageReader) Next() bool {
 			// we don't know this page type, we're allowed to skip non-data pages
 			continue
 		}
-
-		p.buf = memory.NewResizableBuffer(p.mem)

Review Comment:
   Since a new `memory.Buffer` was created at the end here, I opted to create (and release) a new buffer at the start of the function instead.
   
   Alternative fix would be:
   * remove this, so that the buffer is reused across calls to `serializedPageReader.Next` (is this safe?)
   * add a `Release` method to the `PageReader` interface
   * have the `primitiveRecordReader` release the `PageReader`



-- 
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: github-unsubscribe@arrow.apache.org

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