Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Go] IPC Reader leaks dictionary allocations #36981

Closed
thorfour opened this issue Aug 1, 2023 · 0 comments · Fixed by #36982
Closed

[Go] IPC Reader leaks dictionary allocations #36981

thorfour opened this issue Aug 1, 2023 · 0 comments · Fixed by #36982
Assignees
Milestone

Comments

@thorfour
Copy link
Contributor

thorfour commented Aug 1, 2023

Describe the bug, including details regarding any error messages, version, and platform.

The ipc reader may perform allocations to read dictionaries.

memo dictutils.Memo

However these dictionary allocations are never released

func (r *Reader) Release() {
debug.Assert(atomic.LoadInt64(&r.refCount) > 0, "too many releases")
if atomic.AddInt64(&r.refCount, -1) == 0 {
if r.rec != nil {
r.rec.Release()
r.rec = nil
}
if r.r != nil {
r.r.Release()
r.r = nil
}
}
}

Component(s)

Go

zeroshade pushed a commit that referenced this issue Aug 1, 2023
### Rationale for this change

Previously the ipc reader was leaking allocations.

### What changes are included in this PR?

Call `Clear()` on the memo table on final release of the ipc reader.

### Are these changes tested?

Yes

### Are there any user-facing changes?

* Closes: #36981

Authored-by: thorfour <me@thor-hansen.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
@zeroshade zeroshade added this to the 14.0.0 milestone Aug 1, 2023
loicalleyne pushed a commit to loicalleyne/arrow that referenced this issue Nov 13, 2023
### Rationale for this change

Previously the ipc reader was leaking allocations.

### What changes are included in this PR?

Call `Clear()` on the memo table on final release of the ipc reader.

### Are these changes tested?

Yes

### Are there any user-facing changes?

* Closes: apache#36981

Authored-by: thorfour <me@thor-hansen.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants