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

vmq_reg_trie: Use genserver instead of genserver2 for improved memory management #2179

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mths1
Copy link
Contributor

@mths1 mths1 commented Aug 6, 2023

Proposed Changes

We experience from time to time high memory consumption in vmq_reg_trie which can be traced back to genserver2 code. There seems to be no real advantage of genserver2.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes issue #XXXX)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, styles...)
  • DevOps (Build scripts, pipelines...)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.

  • I have read the CODE_OF_CONDUCT.md document
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if needed)
  • Any dependent changes have been merged and published in related repositories
  • I have updated changelog (At the bottom of the release version)
  • I have squashed all my commits into one before merging

Further Comments

If this is a relatively large or complex change, kick off the discussion by
explaining why you chose the solution you did and what alternatives you
considered, etc.

@ioolkos
Copy link
Contributor

ioolkos commented Aug 7, 2023

@mths1 quick question, though. vmq_reg_ordered_trie was supposed to improve the memory usage. Just wondering: Are there other reason you don't use that module?

@mths1
Copy link
Contributor Author

mths1 commented Nov 20, 2023

@ioolkos : I rebased this change. There is no particular reason other than this would improve memory usage more or less for free also for the standard reg_trie. I could not measure any advantage of using genserver2... Let me know if you want to consider merging, otherwise I can also close this PR.

@ioolkos
Copy link
Contributor

ioolkos commented Nov 21, 2023

@mths1 let's keep it open until I'm able to run some sort of bigger test. I want to be sure I understand that there's no change for the handle_event logic.

@codeadict
Copy link
Contributor

genserver2 buffers messages and improves selective receives at the cost of more memory. Probably need to dig back in history why it was used instead of regular gen_server

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.

None yet

3 participants