pingcap / pingcap/ticdc

Possible memory leak caused by slice

Open
#4,137 0 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.