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 garbage collection not working properly and add periodic jemalloc purge #1471
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! I’ve left a few comments, answer appreciated 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good enough. Could we add some test which will check that memory is actually reclaimed after purging it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me. The only option for me that seems possible to add a test is a stress test where we do a bunch of creates and wait for the GC cycle to kick in, so we assert that memory after gc should kick in is lower than before. Check if that is possible, and put a small gc cycle of 5 seconds, and in the meantime, you can do one FOREACH transaction. That is my idea for the test, otherwise, I am not sure
I'm a bit more for having this under one flag only, and not displaying to the user the info about jemalloc. Couldn't hurt since now we have both cycle seconds set to 30 seconds. I'd also add @Ignition to review this before merging. |
this is the code from the interpreter. After doing free memory, it automatically purges it so it's returned back to the process. I would then assume that we need to do both actions with one flag. User should not be concerned about what jemalloc is, and if we ever need to debug it separately, we can do so later |
@imilinovic @Josipmrden I am more than okay to have two separate threads, one for GC for our internal stuff, one for jemalloc. I think users already are impacted by jemalloc via vm.max_map_count and they can read about that already there, so it is one more config that they can set up. Also if jemalloc purge blocks the whole thread, I think it will be too slow to do gc cycles and it might be an issue later on. |
Please discuss with @gitbuda about the feature before we merge this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪
More proactive GC deletion moved to #1508 because I found a bug in it. More info in the PR. |
Fix garbage collection not working properly, add periodic jemalloc memory purge
[master < Epic] PR
[master < Task] PR
This fixes Issue1220
To keep docs changelog up to date, one more thing to do: