On Tue, Nov 17, 2015, at 08:33 AM, Wilson Page wrote:
> Thanks for diving into this Andrew, this is really useful! IIUC you're 
> saying: When a parent window references an object from a child iframe, the 
> child iframe's memory compartment cannot be garbage collected.

Yes, although the parent/child nuance isn't relevant other than the
parent will inherently outlive the child.  It was mentioned that the
revamped music app has several long-lived views/frames, so the immediate
concern there would be if the short-lived views directly send data to
the long-lived views.  Or the long-lived views expose long-lived data
structures to the short-lived views and they mutate them and add their
own data onto the objects.  (Which I would hope wouldn't happen, but if
the expected contract is that the data is fully cloned, then recipients
would feel free to mutate/reuse/etc.)

> Once all references to shared objects are freed in parent and child,
> can the child memory compartment be destroyed? Or once sharing has
> happened does the child iframe compartment have to be kept alive until
> the parent dies.

The cycle collector will be able to collect the iframe compartment once
there are no more live references to objects inside it from other
compartments.
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos

Reply via email to