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

fix memory related #16920

Merged
merged 3 commits into from
Jun 15, 2024
Merged

Conversation

daviszhen
Copy link
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #https://github.com/matrixorigin/MO-Cloud/issues/3388

What this PR does / why we need it:

原因:
1, []byte转string 重新分配了内存。
2, 不停的append 网络payload,会不停的分配堆内存。并且有内存移动。

修改:
1,[]byte转string。用UnsafeBytesToString。
2,先保存payload。最终一次性用mpool分配内存,再拼接。然后mpool释放内存。压力在mpool上,而不是在go heap上了。

image

@daviszhen daviszhen changed the title 0615 fix bytes2string 1.2 fix memory related Jun 15, 2024
@mergify mergify bot requested a review from sukki37 June 15, 2024 04:02
@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Jun 15, 2024
@mergify mergify bot added kind/bug Something isn't working kind/enhancement labels Jun 15, 2024
@mergify mergify bot merged commit c9bda48 into matrixorigin:1.2-dev Jun 15, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working kind/enhancement size/S Denotes a PR that changes [10,99] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants