-
Notifications
You must be signed in to change notification settings - Fork 61
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
Memory leak #74
Comments
It is expected there would not be a lot of inverted matrices required for a run of the application, which may not be a valid assumption, especially after the upgrade to GF16 where the number of possible matrices may be much larger than GF8. At the time of writing the library, most of the efforts was dedicated to making sure the code was sound, and thus this memory leak was overlooked (and also it only supported GF8 at the time). |
Adding a cache eviction procedure would be ideal (obviously), but I think I'm overwhelmed by things at the moment to warrant me implementing it. |
I roughly outline the changes that need to be made as follows to help the fix get started
|
Lastly, I definitely could have documented this memory leak, which I know from the start, better and lodged it as a backlog issue to tackle later on or for others to tackle. At the time of porting from Klaus Post's Go implementation to Rust's, I was mostly focusing on correctness (via heavy testing) and matching the feature parity of Klaus's. Flaws carried over from Klaus's were overlooked if they didn't (directly) lead to incorrect results, such as this bug. Sorry for the inconvenience to whomever is affected, and thanks for reporting @bowenwang1996 ! |
@darrenldl Thanks for the quick response. We have found a workaround so it is not super urgent. |
…#2317) There is a memory leak in the reed solomon code that we use rust-rse/reed-solomon-erasure#74 which results in our nodes crashing after reaching about 100k blocks. This PR fixes it by occasionally reinstantiating the reed solomon instance and cap its memory usage at 500MB. Test plan --------- Make sure existing tests pass.
@bowenwang1996 Just to get some sanity checks before I attempt to do anything: is there a cache eviction policy in mind that you think would enable best performance in, say, your company's use case? I was thinking of just doing a simple LRU, but reckon I should check with others before too late just in case that's a terrible idea. |
I don't have anything specific in mind. I think LRU works. |
I suppose |
first (ugly) attempt rust-rse#74
@bowenwang1996 hello, may you please check if #83 is helping? |
In
get_data_decode_matrix
the inverted matrix will always be added to the trie but nothing seems to every gets removed from the trie, so this can potentially consume a lot of memory. Is it expected that an instance ofReedSolomon<F>
wouldn't be used too many times?The text was updated successfully, but these errors were encountered: