W3C home > Mailing lists > Public > public-webrtc@w3.org > May 2014

Re: [Bug 25724] New: Allow garbage collection of closed PeerConnections

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Thu, 15 May 2014 16:11:10 -0400
Message-ID: <53751F5E.40709@mozilla.com>
To: bugzilla@jessica.w3.org, public-webrtc@w3.org
On 5/15/14 6:21 AM, bugzilla@jessica.w3.org wrote:
> At the moment, the webrtc specification says:
>
> 4.3.3 Garbage collection
>
> A Window object has a strong reference to any RTCPeerConnection objects created
> from the constructor whose global object is that Window object.
>
> In other words, RTCPeerConnections can't be garbage collected.
>
> In certain applications, where a lot of connections are created, used and
> closed, this is a Bad Thing, since you can't get rid of old, closed
> PeerConnections, and you can't reuse them either (there's no return from the
> "closed" state).
>
> Proposal 1: Replace the text with:
>
> A Window object has a strong reference to any RTCPeerConnection objects created
> from the constructor whose global object is that Window object, and whose
> RTCSignalingState is not "closed".

How about:

A Window object has a weak reference to RTCPeerConnection objects created
from the constructor whose global object is that Window object, and whose
RTCSignalingState is not "closed".


That's effectively what Firefox has, e.g. PCs may be garbage collected 
if the JS drops all references to them.

.: Jan-Ivar :.
Received on Thursday, 15 May 2014 20:11:35 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:40 UTC