Hacker News new | ask | show | jobs
by timonovici 3474 days ago
My worst problems were with Toptal's website. I even tweeted them about it, but it still leaked memory like crazy. Maybe they fixed it already, but I wouldn't know - they didn't have articles that interest me in a while.

Anyway. I have Firefox with uBlock, on Archlinux. With JS disabled. 400MB, about a hundred tabs. I do recommend using it that way. I also have Chromium, for things that require JS - youtube, facebook and the like.

1 comments

How can a site leak memory? Javascripts is garbage-collected.
Easy: add it to something that's alive while the site is alive. Here's an example that leaks some memory every 100ms while you have the site open:

  window.leakyArr = [];
  function leakStuff() {
    leakyArr.push("This is leaked" + Math.random());
  }
  setInterval(leakStuff, 100);
Of course if you unload the page this will all be collected. But if you have a page you leave open for a long time and it does stuff like this, it's possible for the page to use hundreds of megabytes of RAM. In fact, twitter does just that if you leave it open for a day or three, for reasons more or less like the above: they're showing or caching all the stuff that came in since you opened the page. That's more and more stuff as time goes on.