Live data from Hacker News

Chrome and Firefox 3.5 Memory Usage

dotnetperls.com

21–30 of 46 posts

Re: Chrome and Firefox 3.5 Memory Usage

#21
post #7

4 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.

I 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?

Of 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.

Re: Chrome and Firefox 3.5 Memory Usage

#22
post #11

During 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…

I 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.

Re: Chrome and Firefox 3.5 Memory Usage

#23
post #17

Ok, but how to interpret the results? If the memory is not used, it is a problem that Chrome takes up so much of it?

The 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.

Re: Chrome and Firefox 3.5 Memory Usage

#24
post #21
post #7

Earlier quoted context omitted.

I 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?

Of 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.

That 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).

Re: Chrome and Firefox 3.5 Memory Usage

#25
post #11

During 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…

I always had that problem with Firefox prior to Firefox 2 and continued to have it with the first several releases of Firefox 2. After some update to Firefox 2 I never saw it again. I would call you crazy or a liar for reporting it with FF3 except that I remember being called (essentially) crazy or a liar when I complained about that problem with early releases of Firefox 2. Plus ça change, I guess.

Re: Chrome and Firefox 3.5 Memory Usage

#26
post #23
post #17

Ok, but how to interpret the results? If the memory is not used, it is a problem that Chrome takes up so much of it?

The 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 "thi…

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

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?

Re: Chrome and Firefox 3.5 Memory Usage

#27
post #24
post #21

Earlier quoted context omitted.

Of 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.

That 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).

> 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.

Re: Chrome and Firefox 3.5 Memory Usage

#28
post #26
post #23

Earlier quoted context omitted.

The 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 "thi…

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 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?

Yes, 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.

Re: Chrome and Firefox 3.5 Memory Usage

#29

Just to note - this is done on Vista, which means that the browser stats may look very different on a different OS.

I 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.

Re: Chrome and Firefox 3.5 Memory Usage

#30

Private 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.

Why 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.
Post reply on HN