-
Notifications
You must be signed in to change notification settings - Fork 291
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(persisted-scope): Prevent memory leaks, fixes #274 #328
Conversation
…ern is allowed already.
We may have to look into deleting files that are too large before reading them in the future because some users reported OOM crashes. In the PR tests Windows didn't report any memory usage raise when reading a 50MB, but no idea if Rust just handles this extremely well or if Windows just doesn't want to report it in time (even though it has like 5 secs lol) Edit: Tested it with the current dev branch and Windows does report the insane memory usage correctly so maybe Rust is indeed doing a great job here 👀 |
(tauri-apps#328) * fix(persisted-scope): Unescape paths before saving to disk. * fix cfg flags * dedupe code * unescape when reading to try to fix existing files * add more patterns. only fix pattern on app start. don't check if pattern is allowed already. * remove dbg log * typo * remove unused imports * clippy * fix compilation with asset-protocol feature flag enabled * update patterns * manually re-save state once * add changefile * remove dbg print
It's not actually a memory leak the plugin just breaks the .persisted-scope file, bloating it up (to 100mb after a few uses/restarts if you actually use the scope) to a point where it gets too large to work correctly.
This PR adds more pattern than strictly necessary to fix existing files seamlessly - well, hopefully at least.
Fixes #274