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 h2 rpc_dump memory leak bug #2661

Merged

Conversation

GreateCode
Copy link
Contributor

What problem does this PR solve?

Issue Number:

Problem Summary:
h2 rpc_dump时 内存泄漏

具体是http和h2都走ProcessHttpRequest方法,在处理rpc_dump时,先AskToBeSampled创建堆对象再判is_http2,若是http2无释放堆对象逻辑。

发压cmd:rpc_press -protocol=h2 xxxx

What is changed and the side effects?

Changed:
h2 req不做AskToBeSampled

修复前:
image
image
image
image

brpc_h2_rpc_dump_mem_leak_bug.pdf

修复后:
image
image
image

brpc_h2_rpc_dump_mem_leak_fixed.pdf

Side effects:

  • Performance effects(性能影响):
  • Breaking backward compatibility(向后兼容性):

Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@GreateCode GreateCode changed the title fix h2 rpc_dump mem leak bug fix h2 rpc_dump memory leak bug Jun 12, 2024
@GreateCode
Copy link
Contributor Author

@chenBright

Copy link
Contributor

@chenBright chenBright left a comment

Choose a reason for hiding this comment

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

LGTM

@GreateCode
Copy link
Contributor Author

@wwbmmm 合下?

@yanglimingcn
Copy link
Contributor

LGTM

@wwbmmm wwbmmm merged commit 2e18318 into apache:master Jun 13, 2024
20 checks passed
chenBright pushed a commit to chenBright/brpc that referenced this pull request Jun 24, 2024
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.

4 participants