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

packet: memory optimization for reading network packet #651

Merged
merged 4 commits into from
Dec 15, 2021

Conversation

zr-hebo
Copy link
Contributor

@zr-hebo zr-hebo commented Dec 10, 2021

What problem does this PR solve?

读取网络包遇到大的 event之后,会导致 buffer冲的很大,之后一直没法释放。从而导致整个程序的内存占用居高不下。

What is changed and how it works?

这个PR对这块逻辑做了优化,只缓存比较小的缓存块,避免了这种情况。

--
The buffer will be increased and can't be released when the packet is very big, thus the memory consumption keeps high.
This PR tries to avoid it.

@lance6716 lance6716 changed the title 读取网络包内存优化 memory optimization for reading network packet Dec 10, 2021
@zr-hebo zr-hebo changed the title memory optimization for reading network packet packet: memory optimization for reading network packet Dec 10, 2021
packet/conn.go Outdated Show resolved Hide resolved
@zr-hebo zr-hebo force-pushed the master branch 2 times, most recently from 38536a6 to f136121 Compare December 11, 2021 04:59
@atercattus atercattus merged commit 3697330 into go-mysql-org:master Dec 15, 2021
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 this pull request may close these issues.

2 participants