What garbage collection algorithms do all 5 major browsers use?
Posted
by Martin Wittemann
on Stack Overflow
See other posts from Stack Overflow
or by Martin Wittemann
Published on 2010-04-19T12:14:34Z
Indexed on
2010/04/19
15:13 UTC
Read the original article
Hit count: 236
I am currently rethinking the object dispose handling of the qooxdoo JavaScript framework.
Have a look at the following diagram (A is currently in scope):
Let's say we want to delete B. Generally, we cut all reference between all objects. This means we cut connection 1 to 5 in the example. Is this really necessary?
As far as I have read hear 1, browsers use the mark-and-sweep algorithm. In that case, we just need to cut reference 1 (connection to the scope) and 5 (connection to the DOM) which could be much faster.
But can I be sure that all browsers use the mark-and-sweep algorithm or something similar?
1 http://stackoverflow.com/questions/864516/what-is-javascript-garbage-collection
© Stack Overflow or respective owner