[Second Review] SE-0371: Isolated synchronous deinit

-1 from me.

My concerns remain the same as for the pitch and therefore I'll just replicate what I wrote then:

I have one main concern with isolated deinits: It introduces GC-style 'do it later' memory reclamation (*) without backpressure into the language.

This system works okay, if the garbage producer (i.e. the piece of code that lets the reference go to ref count 0) is slower as the garbage consumer (i.e. the actor's executor that'll run the isolated deinit). There is no backpressure which means that even if the garbage consumer is overwhelmed, the garbage producer will not be slowed down. That's common in GC'd systems but is usually not the case with ARC. In ARC, the deinit usually run synchronously and in line with the place that decrements the reference to 0. So assuming the backpressure works otherwise, ARC won't break it.
After introducing isolated deinit we could however get to a place where the garbage consumer cannot catch up with the garbage producer and we will start to uncontrollably accumulate memory, possibly until an OOM kill (**).

Some more information and discussion in and in response to my original comment on the pitch: [Sub-Pitch] Task-local values in isolated synchronous deinit and async deinit - #28 by johannesweiss

9 Likes