You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Matthew Topol (Jira)" <ji...@apache.org> on 2022/04/13 17:16:00 UTC
[jira] [Resolved] (ARROW-16163) [Go] IPC FileReader leaks memory when used with ZSTD compression
[ https://issues.apache.org/jira/browse/ARROW-16163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matthew Topol resolved ARROW-16163.
-----------------------------------
Fix Version/s: 8.0.0
Resolution: Fixed
Issue resolved by pull request 12857
[https://github.com/apache/arrow/pull/12857]
> [Go] IPC FileReader leaks memory when used with ZSTD compression
> ----------------------------------------------------------------
>
> Key: ARROW-16163
> URL: https://issues.apache.org/jira/browse/ARROW-16163
> Project: Apache Arrow
> Issue Type: Bug
> Components: Go
> Reporter: Nicolas MOREAU
> Priority: Critical
> Labels: pull-request-available
> Fix For: 8.0.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> I'll submit a PR :)
>
> When using the IPC Reader to read data compressed in zstd, we observed what looked like a memory leak.
> After further debugging, we observed that calling the IPC Reader created goroutines that were never stopped, and consumed memory.
>
> After deeper investigation, we found the following root cause:
>
> In arrow/ipc/file_reader.go, the newRecord function calls getDecompressor, that returns a zstd.Decoder object.
>
> When used in its stream version (calling .Read()), this decoder makes use of a Goroutine with a channel to receive input. This channel is closed by the decoder's .Close() function, which ends the Goroutine and therefore the collection of its memory by the GC.
>
> After using the zstd Decoder, the IPC FileReader should close it to prevent the leak.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)