-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bug: out of memory #18
Comments
Should be fixed in #21, I tested it on my home dir and did not encounter infinite memory growth. BTW, I also added a binary files filtering, as the endless "Invalid UTF-8" errors were really annoying :| |
I don't think it's fixed. Just tried again: I noticed it may take a lot of RAM but then release and then repeats. But, still, I've seen it takes about 29GB once before releasing, so it's still far away from fair RAM use for such a tool. |
It must be loading a super large file, I don't have very large files under my home dir so I'm not experiencing this. I'm in the process of implementing stream processing so that nerdfix only needs to read a small segment of the file instead of the whole into memory. |
Well, sure, there are large files in a home dir. Some of them are even related to this tool 😄
but the largest ones are some game files in And I believe this is normal use case for the tool. Some ideas:
|
Done in #22. Could you help me test it? |
Sure. There are some differences in output between these two versions, but at a glance all of them are okay:
So, looks good to me! |
This is interesting, it may be checking a partially UTF8 file, or reading a binary file unexpectedly (I experienced this problem sometimes, as the content inspector library we use is not 100% accurate and occasionally detects some binary files as UTF-8 files). Anyway, this should be acceptable and the main problem is solved, thanks for your feedback! |
### ✨ Overview This release mainly addresses the high memory usage issue reported in #18: fixed a potential memory leak (#21) and implemented stream processing (#22). Also, some UI changes were introduced in #21, as we switched the diagnostic reporter from [codespan_reporting](https://docs.rs/codespan-reporting/latest/codespan_reporting) to [miette](https://docs.rs/miette/latest/miette). ### 🚀 Features - **(runtime)** Set exact file size limit - **(runtime)** Add file limitation - **(runtime)** Filter out binary files ### 🐛 Bug Fixes - **(cli)** Report the source path of diagnostics (#23) - **(cli)** Subtract with overflow ### 🚜 Refactor - **(runtime)** Implement stream processing - **(runtime)** Zero-copy diagnostics reporting - Replace `codespan-reporting` with `miette` - **(util)** Rename `tryb!` to `try!` ### 📚 Documentation - **(readme)** Update badge URLs ### 🎨 Styling - Format with prettier - Make nightly rustfmt compatible with the stable rustfmt - Format with nightly rustfmt ### ⚙️ Miscellaneous Tasks - Generate UTC release date - Report Cargo check results - Rewrite - Fix typos - Fix typos - Update author name - Add checks (#17) ### 🛠️ Build - **(nix)** Update flakes - **(cargo)** Update dependencies
nerdfix check --format json -r . 2>/dev/null >nerdfix.json
started in my home dir in a minute takes all my RAM (32GB) and begin swapping, so I killed it.The text was updated successfully, but these errors were encountered: