Ehsan Akhgari writes:

> On 2014-03-19, 10:50 PM, Boris Zbarsky wrote:
>> On 3/19/14 10:40 PM, Ehsan Akhgari wrote:
>>> Why do we have to touch that list on shutdown?
>>
>> We Release() all the things in it (nsIWeakReferences in this case).
>
> Well, that was sort of my point (gotta work on my style of being
> overly terse, sorry about that!).  Why do we need to do that?
>
> I just checked and the implementations of the only two
> implementations of that interface (nsWeakReference and
> nsNodeWeakReference) do not have any side effects which will
> result in a write to disk.  So I don't see if we just avoid
> clearing the observer list hashtable at shutdown (I mean, besides
> keeping it enabled in debug builds of course.)

Sounds like there is an optimization that can be applied there,
but that is only half the problem.

The leaked small objects fragment the available heap.

The observer service, and other users of weak references, need
notifications when the objects are destroyed.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to