> On Jul 13, 2016, at 7:18 AM, Michael Kriegel <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> I am not sure, which kinds of garbage collectors the implementations of 
> ECMAScript typically use. If they used a reference counter, which counts 
> "non-weak" references only, a simple check, whether the reference count is 0 
> or not on access to a weak reference would be sufficient.

Reference counting is not “garbage collection” because reference counting can 
not recover circular chains of object references.

Modern garbage collector are complex heuristic-based beasts that try to make 
good trade-offs between latency (how long does an object continue to consume 
storage after it actually becomes unreferenced)  and performance (how much of 
the total processing cycles is consume trying to recover unreferenced objects). 
 Each implementation’s GC uses different heuristics to optimize that trade-off. 
 Thus when any given object would will be observably GC'ed is non-deterministic 
between implementations (and often even within a particular implementation). 

If you want to drill deep into how garbage collectors work, there are lots of 
good resources at http://www.memorymanagement.org/index.html 
<http://www.memorymanagement.org/index.html> 


Allen

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to