The spec has this to say about garbage collecting PeerConnections [1]:
"An RTCPeerConnection object must not be garbage collected as long as any event can cause an event handler to be triggered on the object. When the object's [[IsClosed]] internal slot is true, no such event handler can be triggered and it is therefore safe to garbage collect the object.
All RTCDataChannel and MediaStreamTrack objects that are connected to an RTCPeerConnection have a strong reference to the RTCPeerConnection object."
In Chrome, this is implemented as "if the PeerConnection is closed, we'll garbage collect it; if it's not, it's not".
This means that if you fire up a PeerConnection once in a while to check something, and let it run for a while, you risk hitting the limit on number of PeerConnections, which will give you a "sad tab" unless you close the PeerConnection.
To be specific: This is safe:
every few seconds/minutes/hours
pc = new PeerConnection();
do stuff
pc.close()
pc = null
This will lead to sadness:
every few seconds/minutes/hours
pc = new PeerConnection()
do stuff that doesn't close the connection
pc = null
Enjoy!
Harald