ISSUE-138: 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-ISSUE-138: 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: 138.html,v 1.1 2019/11/08 08:58:02 carcone Exp $