7 ms·
Chrome and Firefox 3.5 Memory Usage
- notaddicted 17y ago4 GB of memory can be had for $50. When I use a computer I usually use: browser + music, OR browser + emacs. I want my browser to be fast and responsive, and the memory isn't being used for anything else.
- scscsc 17y agoI also want my browser to be fast and responsive, but the current trend goes in the other direction. How on Earth can you occupy GBs of memory? How much time does it even take to download a gigabyte of data?
- phillmv 17y agoOf course, it's not the actual downloaded text that takes up all that memory. It's not like programs take up gobs of memory because the programmers were being lazy and disdainful. No, it's the internal representation of the markup, and the program state of all of the javascript programs a page might incorporate, that takes up a lot of memory.
- scscsc 17y agoThat is obvious. What is less obvious is how much memory you can waste for the internal representation. I would expect that the memory footprint of a well-designed browser should be dominated roughly by the download size (w/out taking into account the javascript code, which could keep a lot of state around).
- phillmv 17y ago> should be dominated roughly by the download size Well, judging by the graphs in the linked article this is clearly something that every browser vendor experiences. I imagine that the trade off in speedy page rendering is having a lot of memory intensive data structures. It's prolly more complicated than we give them credit for. I've never liked the griping about memory use - if you're not swapping out to disk then you're perfectly fine. I'm much more concerned with having firefox occupying a whole core if I leave it unattended with too many js intensive tabs open.
- catch23 17y agoSadly the majority of motherboards out there can't handle more than 8GB of memory. Single 4GB chips around $80 now (fully buffered), so it should seem like normal motherboards with 4 slots should support 16GB normally.
- lutorm 17y agoIs the huge memory use from Chrome just because it opens separate processes for each tab? If so, can't some of that memory actually be shared by the OS even though it shows up as duplicated (like what happens if you do vfork?)
- dflock 17y agoNope - the huge memory usage for Chrome is because this analysis is complete rubbish - it's double counting all the shared memory for each process, as you suggested.
- barrkel 17y agoHe is using Process.PrivateMemorySize64 in .NET. It doesn't double-count, because it only counts non-shared pages. Non-shared working set pages are probably the most relevant measure, as a process-per-tab model will have lots of address space and may use memory mapping extensively, and so have lots of non-shared pages, but not actually touch many of those pages, and end up with a relatively small working set. However, .NET's Process class doesn't have an equivalent property to Process Explorer's "WS Private" column. EDIT: Sure enough, a quick eyeball of some Chrome subprocesses using Process Explorer gives me these results: Private WS Private 1416 460 14916 7952 12084 9780 16780 13972 16164 11336 14812 12040 10284 4444 19140 15400 All numbers in KB. Non-shared working set impact on an unloaded machine, probably the most important measure for Windows, is usually quite a bit less than the private bytes.
- barrkel 17y agoHe talks about his utility on this page: http://dotnetperls.com/browser-memory http://dotnetperls.com/browser-memory "It uses the PrivateMemorySize64 long value from the Process collection in .NET." You can get his memory watcher from this page: http://code.google.com/p/dotnetperls-controls/downloads/list http://code.google.com/p/dotnetperls-controls/downloads/list The relevant lines from the "MemoryClass" class: long size = singleProcess.PrivateMemorySize64; double megabytes = ConvertBytesToMegabytes(size);
- Locke1689 17y agoJust to note - this is done on Vista, which means that the browser stats may look very different on a different OS.
- scscsc 17y agoProbably the ratio is to stay, since the other platforms are treated with the same indifference by the developers.
- pyr3 17y agoI don't know if this is relevant or not, but Safari uses OSX's ported libraries as DLLs. If the memory size of those DLLs is being used, it would show up as less memory usage on an OSX machine due to those libraries being a shared part of the main OS.
- sarvesh 17y agoYou really can't compare a beta or Release Candidate with final versions of other browsers that most definitely will put your numbers off.
- scscsc 17y agoDo you have any strong data stating that the final release of some software is in general more memory friendly as opposed to the beta version? I don't have data for the counterpoint either, but I'm willing to bet the developers have other priorities (i.e. bug fixes as opposed to optimization). Once you've maldesigned your software w.r.t. performance, you can't do much except to wait for hardware to catch up.
- sarvesh 17y agoBeta versions of software include debug information. This is pretty much a standard practice, even I do it. It helps me understand where things went wrong and how it could be improved. When you do the final version you generally get rid of the debug information which more often than not will reduce memory consumption. This is different from optimization.
- scscsc 17y agoI doubt the beta comes with debug information (not your beta, theirs). I don't use Windows -- it should be easily checkable by someone who does.
- deleted 17y ago[deleted]
- chops 17y agoDuring the experiment, 384 memory checkpoints were taken, which amounts to 1152 seconds or 19.2 minutes. My problem with Firefox has always been with having the browser open for a long time (days) and running multiple tabs, including having an open Gmail window constantly. By that point, Firefox is always sluggish and painful. Closing the browser the natural is a waste of time because it takes so long for the memory to free up, and killing the process altogether is the only thing that does anything to buy me some clock cycles. I'd like to see the results of a long-term test of that nature.
- bmj 17y agoAre you using the latest FF 3.5 release candidate? I noticed this issue with previous versions, but it seems like the latest RC is much better.
- chops 17y agoI am. And granted its memory management is getting better with each release (memory usage improved greatly from 2 to 3). Admittedly, I haven't had 3.5 RC long enough for a very extensive experience. I'm speaking primarily of FF3, which for me could get quite painful even switching tabs (especially with Gmail open on one tab). It could be better, but 3.5 RC has only been out a few days. At first, I loved the shit out of FF3, but after a while, I found myself getting furious (at least working on my laptop; on my desktop, which is a beastly gaming machine, I don't have nearly as many complaints).
- bmj 17y agoI found the same problem with FF3, which prompted me to try the 3.5 releases.
- ori_b 17y agoI agree. Closing firefox through file->quit takes at least 30 seconds for me, during which I can hear the laptop's fan spinning up. Usually I just kill -9 it because I don't have the patience to wait. Firefox 3.0.11, on a dual-core low-voltage laptop with 1 gig of ram. It's fast enough to run everything I care about but firefox.
- s3graham 17y agoPrivate bytes or address space? Shared readonly counted twice? I happily suffer Chrome's stupid tab design and lack of Flash (on Ubuntu) for much better end-to-end performance, whether it takes up more memory or not.
- tdoggette 17y agoWhy don't you like Chrome's tab design? I was a little off-put when I first saw it, but it makes sense for tabs to live at the top edge of the screen from a Fitt's Law perspective: when you move your mouse upwards to interact with the browser, it's to deal with tabs (so they deserve the larger target). When you want to hit the address bar, you hit ctrl+t to get a new tab in which it's already selected.
- s3graham 17y agoTabs have always seemed like a horrible misfeature to me. The OS already provides a taskbar, so now you've created N*M places to look. Not only that but you can't see all the tabs at the same time once there's multiple windows, so you have to pick a window, check all of its tabs, move to the next and repeat. The "it's like MDI/documents/text editors" argument is bogus because the window that contains gmail has nothing to do with the window that contains HN, or reader.google, or whatever. It's like all the programs written in C++ get their own taskbar, separate from the ones written in VB, separate from the ones written in JS. Except we only separate the JS ones for some reason. For Chrome specifically: 1) it lacks the option "New pages should open in [X] a new window [ ] a new tab" compared to Firefox, which makes tabs ignorable. 2) On Windows, I'd much rather they follow the OS conventions for MDI rather than make up their own "cool"/"clever" one (see media/audio players, for some random reason). All of a sudden, for example, you can't double-click in the top left to close. Well, way to be clever, but that's crap.
- snprbob86 17y agoThe lack of top-left corner double-click drove me nuuuuts. Until I found out that you could middle-click to close tabs.
- grandalf 17y agowhat about firefox + firebug compared to chrome?
- greyman 17y agoOk, but how to interpret the results? If the memory is not used, it is a problem that Chrome takes up so much of it?
- ori_b 17y agoThe problem is that the memory is used by other programs when I want to start them up. Don't get me wrong, caches are great. However, it's one thing for the OS to cache stuff, because it can easily drop caches when memory pressure rises. Userspace software in current systems have no good way of knowing the memory pressure, and no good way of responding to it by dropping caches to free up memory. (yes, an API for "this memory is a droppable-at-any-time cache" would be nice in OSes, but it doesn't exist at the moment, and getting one that's easy to use would be hard). More or less, that means that software that uses more memory in userspace causes swapping and lame performance. And honestly, there is no good reason for a browser to easily be the most resource intensive program on my system. Even games tend to be far lighter than browsers.
- dkarl 17y agoan API for "this memory is a droppable-at-any-time cache" would be nice in OSes, but it doesn't exist at the moment Naive question: would this be any better than letting applications provide swapping hints to the OS? And is that any better than just letting the OS swap based on usage?
- ori_b 17y agoYes, to a certain degree. The problem is that it would be cheaper to, say, drop a decoded version of a JPEG and re-decode it, instead of having it get swapped out. In fact, I suspect that for large images, it would be cheaper to re-read the compressed jpeg and decompress it than to read back a larger swapped out decompressed version, just because hitting the disk is slow, and swap tends to get fragmented because it's usually written a few pages at a time. Swap hints probably aren't really worth the effort, although I haven't benchmarked it. The idea behind caches is to avoid doing expensive operations repeatedly, and hitting swap is about as expensive as an operation can get.
- midnightmonster 17y agoChromium dev list discusses these results: http://groups.google.com/group/chromium-dev/browse_thread/thread/f97adb063b97a81 http://groups.google.com/group/chromium-dev/browse_thread/th... TLDR: Vista's default memory readout is actually pretty good for simply adding together like this and getting reasonable numbers WRT shared libs. Chrome really does use tons more memory than FF 3.5 with simple pages in many tabs. Chrome devs chose stability, security and foreground tab prioritization over lower mem use on purpose. They don't think this test much reflects what people actually do with their browsers.