Open Smotrov opened 5 months ago
Add buff_vec.shrink_to_fit()
before inserting into the HashMap
, it would remove the unused capacity in the Vec
reserved (to achieve amortised O(1)
push).
Add
buff_vec.shrink_to_fit()
before inserting into theHashMap
, it would remove the unused capacity in theVec
reserved (to achieve amortisedO(1)
push).
Thank you. Unfortunately does not helps.
I know it is always strange to talk about memory leaks in Rust. But anyway... My app is constantly working with queue of tar files with about 10K entries. And the memory used is slowly growing over time for no reason. After investigation with Xcode instruments it showed that there is a memory leak on the very simple line
entry.read_to_end(&mut buff_vec)?;
Has anybody faced the same problem?
Any ideas how to address that?