Browser Memory Usage: Firefox, Safari, Opera, Chrome

Web hosting, SEO, etc... related
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Saman » Thu Jul 14, 2011 3:21 pm

Sam Allen from DotNetPerls.com has tested some of the most popular web browsers to find out which one of them consumes the most and least memory. He used Firefox 3.5 RC, Safari 4, Opera 10 Beta and Google Chrome 3.0 Dev for this test. Using script help, he has loaded 150 the most popular sites as per Alexa.com and monitored results.
memory-usage.png
memory-usage.png (24.21 KiB) Viewed 8665 times
Maximum memory used
Peak memory usage measured during experiment.

Chrome: 1216.16 MB [Largest]
Firefox: 327.65 MB [Smallest]
Opera: 554.11 MB
Safari: 517.00 MB


Average memory used
Average of all memory checkpoints throughout experiment.

Chrome: 543.83 MB [Largest]
Firefox: 166.82 MB [Smallest]
Opera: 347.45 MB
Safari: 319.44 MB


Final memory used
Figures taken after all tabs were closed at end.

Chrome: 109.49 MB
Firefox: 106.66 MB [Smallest]
Opera: 441.49 MB [Largest]
Safari: 349.62 MB
Firefox 3.5 also had the best average memory usage figures, meaning that it may consume the least memory of these browsers when used for the Alexa sites as tested in the benchmark. Finally, Chrome and Firefox posted the best memory figures at the end of the browsing session, with Opera consuming 4.1 times more memory than Firefox at the end of the test.
Here we see the source code written in the C# that issues commands to the browsers specified in the static string array. All the five browsers support command-line arguments of the form of a URL with no prefix. The program uses pauses with the Thread.Sleep method to try to introduce more unpredictability into the benchmark. This could avoid edge cases where the a certain timing could interact with a browser's cache algorithms in a less representative way.

Code: Select all

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;

class Program
{
    /// <summary>
    /// Number of points to close stuff.
    /// </summary>
    const int _interrupt = 30;

    /// <summary>
    /// Browsers urls are sent to.
    /// </summary>
    static string[] _browsers =
    {
	@"C:\Program Files\Mozilla Firefox 3.5 Beta 4\firefox.exe",
	@"C:\Program Files\Safari\Safari.exe",
	//@"C:\Program Files\Internet Explorer\iexplore.exe",
	@"C:\Program Files\Opera 10 Preview\opera.exe",
	@"C:\Users\Sam\AppData\Local\Google\Chrome\Application\chrome.exe"
    };

    static void Main()
    {
	var r = new Random();
	var ct = 1;
	foreach (var url in GetUrls())
	{
	    if ((ct % 30) == 0) // Notify
	    {
		Console.BackgroundColor = ConsoleColor.DarkRed;
		Console.ForegroundColor = ConsoleColor.White;
		Console.WriteLine("Close all tabs but one in all browsers then press enter.");
		Console.ResetColor();
		Console.ReadLine();
	    }
	    foreach (var b in _browsers) // Loop through browsers
	    {
		try
		{
		    var info = new ProcessStartInfo(b, url);
		    Process.Start(info); // Start url in this browser
		    Thread.Sleep(r.Next(100, 1000)); // Sleep 100 ms - 1 s
		}
		catch
		{
		}
	    }
	    Thread.Sleep(r.Next(2000, 5000)); // Sleep 2 - 5 seconds.
	    ct++;
	}
    }

    /// <summary>
    /// Get list of top 2000 urls.
    /// </summary>
    static IEnumerable<string> GetUrls()
    {
	return File.ReadAllLines("top.txt").Where(item => item != null &&
	    item.Length > 1 &&
	    item[0] != '#').Select(item => "http://" + item);
    }
}
Chathura
Sergeant Major
Sergeant Major
Posts: 33
Joined: Mon Mar 08, 2010 2:42 pm

Re: Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Chathura » Thu Jul 14, 2011 4:05 pm

It's firefox 3.5 and chrome 3.....
things changed a lot since then :) ..........
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

Re: Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Saman » Thu Jul 14, 2011 5:26 pm

Yes. But memory usage looks the same. I was having problems today with browser memory usage and found this article. I run Firefox 5 and Opera 11. But usage looks the same. Anyway, Firefox seems the most memory efficient browser.
Chathura
Sergeant Major
Sergeant Major
Posts: 33
Joined: Mon Mar 08, 2010 2:42 pm

Re: Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Chathura » Thu Jul 14, 2011 6:08 pm

firefox will OK if no addons.
but There are many addons which we cant live without.
I am using firefox only for advanced web debuging. Every time I open firefox it ends with Lots of RAM and almost I always have to kill the process
User avatar
Herath
Major
Major
Posts: 417
Joined: Thu Aug 05, 2010 7:09 pm

Re: Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Herath » Thu Jul 14, 2011 8:18 pm

I am using firefox since I started to spend more time on internet. I love it. I have chrome installed, but I do not use it. I feel so limited when using chrome.
and right now firefox is using only 268MB of main memory with 5 tabs open.

I have noScript, ebay addon, lastpass addon, adblock,flash got, xmark and test pilot addons.
Chathura
Sergeant Major
Sergeant Major
Posts: 33
Joined: Mon Mar 08, 2010 2:42 pm

Re: Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Chathura » Fri Jul 15, 2011 12:52 pm

Herath wrote:I am using firefox since I started to spend more time on internet. I love it. I have chrome installed, but I do not use it. I feel so limited when using chrome.
and right now firefox is using only 268MB of main memory with 5 tabs open.

I have noScript, ebay addon, lastpass addon, adblock,flash got, xmark and test pilot addons.
try more than 8-10 tabs........... Firefox stuck, but chrome don't show any problem( even more than 15 tabs).
My favorite was Firefox until i switch to chrome. Now To me Firefox is really slow. Only reason to use firefox now is firebug and liveHTTPHeaders addons........
I can't even beleve chrome use much memory than firefox :roll: ......
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

Re: Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Saman » Fri Jul 15, 2011 1:00 pm

You can change the code for new executable path for browsers and see yourself. I don't agree Firefox stuck with few tabs. I have about 20 tabs always open with it and it never stuck or slowed down. So there must be a problem in your PC, installation or add-ons. Just disable all add-ons and try. Add-ons are written by 3rd parties and needs to be installed at your own risk. I can write an add-on myself which will slow down browsing by many methods.

It is not fair you try Firefox with add-ons and Chrome without anything. Chrome sucks even without some of the useful features that other browsers provide these days on my Quad Core.

Can you confirm that Firefox stuck even after disabling all add-ons?
Chathura
Sergeant Major
Sergeant Major
Posts: 33
Joined: Mon Mar 08, 2010 2:42 pm

Re: Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Chathura » Fri Jul 15, 2011 1:27 pm

OK I give up there was some install problem. I have to consider that turn back to firefox....... :geek:
Chathura
Sergeant Major
Sergeant Major
Posts: 33
Joined: Mon Mar 08, 2010 2:42 pm

Re: Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Chathura » Mon Jul 18, 2011 3:12 pm

Not Good......
Fresh install work fine until i go to 10 tabs...
Addons were web dev,firebug,HTTPfox
always 500+ memory usage????
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

Re: Browser Memory Usage: Firefox, Safari, Opera, Chrome

Post by Saman » Mon Jul 18, 2011 3:18 pm

Please provide some more information.

1. Can you disable all plugins and see what happens. One of the addons you use is well known as memory eater ;)
2. Can you tell us your PC configuration/OS

Thanks.
Post Reply

Return to “Web Related”