Hacker News new | ask | show | jobs
by danneu 4284 days ago
Example of Google's Closure Compiler eliminating the memory leak:

    var theThing = null; 

    function replaceThing() {
      theThing = {
        longStr: Array(1E6).join("*"),
        someMethod: function() { }
      }; 
    } 

    setInterval(replaceThing, 1E3);
http://closure-compiler.appspot.com/home