On Github TeeBrysiewicz / gc-talk
Created by Tobias Brysiewicz / @tbrysiewicz
It is how memory is released automatically based on accurately finding unneeded memory using a mark-and-sweep algorithm.
Because nothing good ever came out of lag.
Except leading in Gunz.
var another = null; function test() { var str = 'A string I am'; another = str; } test();
"delete" fails to actually delete.
var m = 'test'; delete m; m === 'test'; // true - oops, still a value
The Garbage Collector will collect null.
var m = 'test'; m = null; m === 'test'; // false
var s = { data: 'test' }; s.data = null; s = null;
var obj; var leakMemory = function() { obj = document.getElementById("DivElement"); obj.expandoProperty = obj; obj.bigString = new Array(1000).join(new Array(2000).join("XXXXX")); };