Bobby Holley wrote:
This won't solve esoteric cross-vat use cases, but I think it would be a
nice way to bulldoze the subtle gotchas that make it so easy to introduce
subtle leaks in large-scale JS.

With an MVC framework, nukeSandbox is of no avail. The subject does not want to extend the lifetime of the object it observes, but it need not be notified exactly when that object "becomes garbage" semantically. It could be at a later event turn -- just not so late that garbage piles too high.

This suggests a solution, which I thought was standard in GCs with weak refs (but I'm rusty): tenure any weak referent as soon as it is know to be such (even if it might not be weakly referred to for its entire lifetime). Let people buy trouble by the yard (or more, if they tie combinatorially explosive knots) until the tenured generation is big enough that a full M&S GC must be done.

Anyway, that's the theory (modulo bugs in my memory) and IIRC it suffices for weak maps, which we already implement. Are weak refs any worse (as Igor asks, are they not "better" by some measures)?

/be
_______________________________________________
dev-tech-js-engine-internals mailing list
dev-tech-js-engine-internals@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to