Skip to content

Fix memory leak of ArenaRpcPBMessageFactory#2798

Merged
wwbmmm merged 1 commit into
apache:masterfrom
chenBright:fix_arena
Oct 29, 2024
Merged

Fix memory leak of ArenaRpcPBMessageFactory#2798
wwbmmm merged 1 commit into
apache:masterfrom
chenBright:fix_arena

Conversation

@chenBright

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number:

Problem Summary:

What is changed and the side effects?

Changed:

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.(请遵循贡献者准则).

@chenBright chenBright force-pushed the fix_arena branch 2 times, most recently from 7345d21 to 1d0acd1 Compare October 28, 2024 14:23
@wwbmmm wwbmmm merged commit 633039c into apache:master Oct 29, 2024
@chenBright chenBright deleted the fix_arena branch October 29, 2024 03:48
@sikey647

Copy link
Copy Markdown

@chenBright 请问下,这里使用 arena.Reset() 是直接释放内存;还是说内存空间保留,只是清理空间上的内容。

@chenBright

Copy link
Copy Markdown
Contributor Author

析构后释放内

  // Frees all storage allocated by this arena after calling destructors
  // registered with OwnDestructor() and freeing objects registered with Own().
  // Any objects allocated on this arena are unusable after this call. It also
  // returns the total space used by the arena which is the sums of the sizes
  // of the allocated blocks. This method is not thread-safe.
  uint64_t Reset() { return impl_.Reset(); }

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.

3 participants