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

sink: fix the memory leak in sink manager #1401

Merged
merged 2 commits into from
Feb 4, 2021
Merged

sink: fix the memory leak in sink manager #1401

merged 2 commits into from
Feb 4, 2021

Conversation

zier-one
Copy link
Contributor

@zier-one zier-one commented Feb 3, 2021

What problem does this PR solve?

fix the memory leak in sink manager, this bug is import by #1247

What is changed and how it works?

https://github.com/pingcap/ticdc/blob/6febbae2ec0425fcad6ad74a0644ec595ccc0189/cdc/sink/manager.go#L149

image

  • The blue squares represent the space referenced by t.buffer
  • The yellow squares represent space that has been discarded by the t.buffer
  • All squares that are not white hold a reference of RowChangeEvnet

The yellow squares is unreachable but can't be GC, because the b.buffer reference the array and the array include the yellow squares, the GO GC can't reclaim this space.

Check List

Tests

  • Unit test
  • Integration test

Release note

  • No release note

@zier-one zier-one changed the title fix mem leak fix the memory leak in sink manager Feb 3, 2021
@overvenus
Copy link
Member

Please label your PR and follow PR title style, thanks!

https://github.com/pingcap/community/blob/master/contributors/commit-message-pr-style.md

@zier-one zier-one changed the title fix the memory leak in sink manager sink: fix the memory leak in sink manager Feb 4, 2021
@zier-one zier-one added type/bugfix This PR fixes a bug. status/ptal Could you please take a look? labels Feb 4, 2021
Copy link
Contributor

@amyangfei amyangfei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 4, 2021
@liuzix
Copy link
Contributor

liuzix commented Feb 4, 2021

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Feb 4, 2021
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Feb 4, 2021
@zier-one
Copy link
Contributor Author

zier-one commented Feb 4, 2021

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 4, 2021
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit a37efea into master Feb 4, 2021
@overvenus overvenus deleted the fix_leak branch March 6, 2021 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. status/ptal Could you please take a look? type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants