Re:Rust: Dropping heavy things in another thread can make yo...
by titzer on Sunday May 31, 2020 @06:30AM
(#23368571)
This is most decidedly not true for generational GCs, and for concurrent GCs, the tracing work happens asynchronously and in parallel, on other cores, not taking time on the main thread.
[ Parent
| on HN ]
Re:Rust: Dropping heavy things in another thread can make yo...
by jeffdavis on Sunday May 31, 2020 @11:00AM
(#23369968)
You still have to scan the oldest generation at some point; otherwise (assuming some activity) you'll be leaking memory there over time.
Moving the work to another core doesn't really change my statement.
Aside: I wonder if it's feasible to switch to reference counting for the oldest generation? That would move the problem back to deallocation. I'm not sure if that's a good trade-off, but it would be interesting.
Re:Rust: Dropping heavy things in another thread can make yo...
by tsimionescu on Sunday May 31, 2020 @06:51AM
(#23368654)
It's still true for generational GC, but the costs are more complicated. Even objects in the oldest generation are periodically scanned in most implementations (though there are some, like Clozure CL's GC, that never scan the old generation automatically).
But generational GCs do improve massively on this problem.