-
Notifications
You must be signed in to change notification settings - Fork 262
Adding a method to clear the Gimli symbol cache #226
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
Conversation
Thanks for the PR! Could this perhaps avoid picking up a dependency on Additionally if this didn't actually fix the issue for you I wonder if there's some more investigation to do? There may be more caches that need to be cleared in this crate somewhere I'm not realizing? (one may be libunwind which may have its own set of internal caches) |
Sure, I can avoid
Actually this PR fixed my problem! The extra memory leftover that I mentioned on the other issue was... the |
Thanks again for this! |
Thank you for helping me with this! |
Ah no worries I don't tend to be too strict with commit history, it's all good! |
As discussed in #222 , in my use case I can't really afford each process to lock hundreds of mb's per thread in the
backtrace
symbol cache.I've added a
clear_symbol_cache()
function to the root of the crate that clears the Gimli mapping cache and uh, does nothing at all if you aren't using Gimli.I tried to fix libbacktrace as well, but that one doesn't expose a way to free its state even in C.
I'm not that good at Rust still so this PR is more of a prototype, let me know if anything is terrible :)
I know that a few things could be improved:
lazy_static
?fn noop_clear_symbol_cache() {}
again for each backend is ugly.Anyway, there it is.