Possible memory leak caused by slice
Open
@wk989898 is already working on this.
Since Feb 5, 2026.
type/bug
- Dominant language
- Go
- Stars
- 56
- Forks
- 63
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 34
Description
Memory leaks caused by slices in Go occur when a small, derived slice (or substring) holds a reference to a large underlying array, preventing the garbage collector from freeing the unused, large memory block. The entire original array remains in memory as long as a single sub-slice points to it.
Starting with 1.22, the new slices package and its Delete function uses clear to allow GC to free data even if it's represented by pointers.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.