data icon indicating copy to clipboard operation
data copied to clipboard

feat: ResourceManager (tracing GC approach)

Open runspired opened this issue 1 year ago • 0 comments

this is exploration for an RFC exploring the idea pitched in #8162

see also #9518 for V3 Cache spec exploration which this would tie into.

I'm about 70% confident in the approach I've laid out being viable without mucking with performance too much, but proof will be in the pudding as they say.

An alternative is to only trigger GC on request dismount, either still via WeakRef or by explicit ref counting via Request component usage or early adoption of the explicit resource management API: but that would force everyone into a less flexible set of patterns which would be not-useful. We'd also have to assume every record was always a potential candidate in this alternative case, though the initial weed-out would likely be quick in the first pass. WeakRef only for requests + iterate all resources vs just marked ones may be just as good an outcome overall though. What it lacks is the safety of not eliminating records that users have either accidentally or intentionally retained in their components.

runspired avatar Nov 26 '24 10:11 runspired