Re:Identifying Rust's collect:<Vec<_>>() memory leak footgun
by crotchfire on Friday January 19, 2024 @03:57AM
(#39053221)
Also the latter is the bane of lazy languages, which make space leaks both commonplace and extremely difficult to notice.
Memory leak: classical C style, fully lost in memgrind (runtime bug) Space leak: Some memory structure requires significantly more memory than it should. E.g. keeping a (lazy) ref to a large blob, around that keeps it in memory.
The effect is largely the same, but the latter is almost harder to spot, since the tooling cannot be as general as memgrind.