ISSUE-136: Issues related to garbage collection

Issues related to garbage collection

Network Service Discovery
Raised by:
Frederick Hirsch
Opened on:
issues on garbage collection raised by Adam Barth!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.
Related Actions Items:
No related actions
Related emails:
  1. dap commit: Add changelog to NSD API Candidate WD (from on 2014-02-18)
  2. dap commit: Remove broken Promise links from NSD Proposed Working Draft Specification and replace with Note (from on 2013-09-23)
  3. dap commit: Move proposed NSD API working draft to 17/09/2013 pending resolution of Promise references issue (that they have been removed from the WHATWG DOM spec and we need references before publication) (from on 2013-09-12)
  4. dap commit: Moving Network Service Discovery API Working Draft to 12th September publication date (from on 2013-09-11)
  5. dap commit: Upload Working Draft Candidate Spec - 5th September 2013 (from on 2013-09-02)
  6. Draft Minutes 21 August 2013 teleconference (from on 2013-08-21)
  7. Agenda - Distributed Meeting 21 August 2013 (from on 2013-08-20)
  8. [admin] draft minutes teleconference 14 Aug 2013 (from on 2013-08-14)
  9. Agenda - Distributed Meeting 14 August 2013 (from on 2013-08-13)
  10. Re: DAP-ISSUE-136: Issues related to garbage collection [Network Service Discovery] (from on 2013-08-12)
  11. dap commit: Fix [DAP-ISSUE-136]: Issues related to garbage collection (from on 2013-08-12)
  12. DAP-ISSUE-136: Issues related to garbage collection [Network Service Discovery] (from on 2013-08-09)

Related notes:

No additional notes.

Display change log ATOM feed

Anssi Kostiainen <>, Reilly Grant <>, Chairs, Fuqiao Xue <>, Staff Contact
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <>.
$Id: 136.html,v 1.1 2019/11/08 08:58:01 carcone Exp $