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

Vector删除操作可能会内存泄露 #117

Closed
goldpasser opened this issue Jun 25, 2023 · 4 comments · Fixed by #118
Closed

Vector删除操作可能会内存泄露 #117

goldpasser opened this issue Jun 25, 2023 · 4 comments · Fixed by #118

Comments

@goldpasser
Copy link

golang/go#54650
https://natan36.medium.com/gos-memory-leak-caused-by-slice-742d668bcfa6
如果Vector存放的是指针,删除有可能内存泄露。

@chen3feng
Copy link
Owner

chen3feng commented Jun 27, 2023 via email

@chen3feng
Copy link
Owner

有什么好的方案吗?

@chen3feng
Copy link
Owner

Pop和Remove确实会,我改为用零值填充

@goldpasser
Copy link
Author

好像也只能这样了

chen3feng added a commit that referenced this issue Aug 17, 2023
* Fix memory leak when clean or remove from vector, close #117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants