DAP-ISSUE-137: Issues related to garbage collection [Network Service Discovery]

DAP-ISSUE-137: Issues related to garbage collection [Network Service Discovery]

http://www.w3.org/2009/dap/track/issues/137

Raised by: Frederick Hirsch
On product: Network Service Discovery

issues on garbage collection raised by Adam Barth

https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/network$20service$20discovery/blink-dev/HT0KZKuTLxM/S3w-SdvjZfUJ

2) The requirements in the garbage collection section seem quite onerous and unlikely to be correct.  There area a number of problems with these requirements:

  a) The specification states that a certain object must not be garbage collected until the user navigates away from a particular origin.  Chrome uses a multiprocess architecture in which a given origin might be present in multiple processes.  If we implemented this requirement, we might need to keep a process alive just to avoid garbage collecting this object if the user happened to be viewing another page from the object's origin in another process.  Even if this requirement were scoped to a given process, this requirement would still cause use to keep the object alive much longer that reasonable, effectively leaking resources.

  b) The specification requires that we garbage collect certain objects at the same time that we garbage collect certain other objects.  It's not clear to me what the author of that requirement intended, but, as written, the requirement is problematic:

    i) The requirement mandates a finalizer for the NetworkService objects that can change a web-visible property from true to false, giving scripts the ability to detect when garbage collection occurs.  We've carefully avoided giving scripts this visibility into the internal details of the garbage collector to avoid having to mimic garbage collector quirks across user agents.

    ii) It's not clear what behavior the user agent is required to exhibit if script keeps a reference to a NetworkService object but does not keep a reference to the corresponding NetworkServices object.  Perhaps the requirement would better be phrased as forbidding collection of the NetworkServices object in this situation rather than mandating the garbage collection of the NetworkService object?  As written, this requirement would leave script with a reference to an object that had already been garbage collected, violating a basic invariant of the garbage collector.

Received on Friday, 9 August 2013 18:55:51 UTC