For some reason that still eludes me, after all these years, browsers, no matter which, suffer from terrible memory leaks. I have a feeling that it has to do with plug-in’s in general and Adobe’s Flash in particular. Just open a browser, any browser, load your favorite web site and go eat lunch.
When you return, start your favorite task manager and take a close look at memory usage.
Those very creative, animated, and incredibly-annoying ads with telepathic powers that know not just what web sites you visited last night but what products you looked at as you were johnesing for material gratification, will eat your computer alive, for lack of better terms, and today, fed-up with this crap, I decided to take matters into my own hands – and it was gratifying to see all those pesky ads disappear as if by magic on every page as I reloaded it. But the most amazing thing was to watch the graph for cpu-usage go quiet and the one for memory consumption go down to acceptable levels. So much, that I wondered why the hell I didn’t do this before. Maybe I do like ads, after all, but don’t take me wrong, I don’t mind one bit living an online life that’s uninterrupted by commercials.
The best part is that reaching this non-consumerist nirvana required absolutely no new software or plug-in’s. All it took was a file. A simple text file: hosts.txt (or plain “hosts” if you use a Mac or any of a gazillion Linux incarnations).
The hosts file is like a little black book of addresses. Whenever you enter a url in a browser (i.e. blogsperiment.wordpress.com), your computer looks at the hosts file to see if the IP address corresponding to that URL is there. If it is, your browser starts communicating with the web server at that IP address. If it isn’t, it asks your router or your Internet Service Provider’s DNS server for it. Do you see where I’m heading with this?
Wouldn’t it be great if your host contained entries for all the servers that push those ads on you, but instead of having them point at their correct IP addresses have them point at dead-ends?
Dream no more. There is a hosts file out there that does exactly this. You can download it from http://winhelp2002.mvps.org/hosts.txt. This hosts file contains entries for over 10,000 servers.
I won’t go into the details on how to do it, but all you need to do is download the above file and append its contents to your system’s current hosts file (in Mac and Linux, the file’s in the /etc directory and in Windows, it’s kept in the c:\windows\system32\drivers\etc folder).
If you want to see the magic as it happens, open a few browser windows and have them point to web sites that you know to display ads, then modify your hosts files as explained above, and now go back to your browser windows, hit the refresh button, and weep.
The following links describe ways in which your hosts file can be updated automagically, if you don’t feel like doing it by hand:
– For Windows: http://winhelp2002.mvps.org/hosts.htm
– For Mac/Linux: http://www.putorius.net/2012/01/block-unwanted-advertisements-on.html
: It’s been two hours since the change and after purposely-crashing chrome, so it would reload all the pages I had open (about 40 tabs altogether) EVERYTHING is running much more smoothly than before.