why are web browsers so memory-heavy?
I sometimes think that a fun project would be "8.04 forever": something that keeps ubuntu 8.04 LTS going for the rest of time. Specifically its memory requirements. That's because: Last night I tried taking a discarded "windows 2000 vintage" computer (1/2 gig RAM), putting tiny core linux on it, and then using tiny core's mechanism for installing the firefox that they provide, which is presumably a low-resource version. The result was dreadful: you use firefox and it immediately uses all RAM. Even a 1gig machine cannot work with current versions. Now the standard advice given is "don't use a very old distro for low-RAM machines since it will miss security and other bug fixes; you should instead use a modern distro that's tailored for low resource". The problem is that people will want a browser that's featureful enough (i.e. not dillo or any other simple html renderer). Today I looked at qupzilla, but I have not yet tried it on a low-resource machine. I suspect that a lot of the problem lies in interactions with the X server, buffers, offscreen pixmaps, and many other things I know only a bit about. Anyone have any real knowledge on low-resource browsing?
Mark Galassi writes:
The result was dreadful: you use firefox and it immediately uses all RAM. Even a 1gig machine cannot work with current versions.
Yes, browsers are possibly the most apt example of Wirth’s Law in action.
Now the standard advice given is "don't use a very old distro for low-RAM machines since it will miss security and other bug fixes; you should instead use a modern distro that's tailored for low resource".
Indeed. While performance is important, security is even more important. I cannot in good conscience ever recommend an out of date browser. Consider: Firefox’s PDF viewer had a severe bug that allowed malicious or compromised ad servers to steal your SSH keys; it was only fixed in August of last year. Every time there’s a CA breach like DigiNotar, its certificates are blacklisted in a browser update (because the state of HTTPS certificate revocation handling is… not good). Fundamental weaknesses in old encryption protocols like SSLv3 and TLS 1.0 keep getting found every few months; usually the most important defensive action you can take is updating to the newest release of your browser. No matter how much faster they would be, using old (and thus *necessarily* insecure) browsers is not an option.
The problem is that people will want a browser that's featureful enough (i.e. not dillo or any other simple html renderer).
Personally I use NetSurf for lightweight browsing. It’s the only browser in my experience that runs at a bearable speed on old PowerPC machines. That said, while it makes a valiant effort at rendering the modern web, its JavaScript support (while improving all the time) is still effectively nil. When I find the time, I’d like to spend some time improving NetSurf’s web compatibility and its security. Personally I see a lot of potential in NetSurf because it keeps a small codebase. Part of the problem with large browsers is they simply have too much code to be manageable. NetSurf builds in under three minutes on my machine; Firefox takes over 70 minutes. Chromium has been building well over an hour and shows no sign of finishing soon. (Using four cores!!!) I don’t use Dillo much. My impression of it is not great. I even saw this email just yesterday: https://marc.info/?l=openbsd-ports&m=146056872032709&w=2 I suspect Mozilla’s new Servo engine will be significantly faster than current (Gecko‐based) Firefox for at least two reasons: deprecating XUL and distributing to multiple cores. Both of those are great steps, but I don’t trust Mozilla to write decent code – they’ve been one of the worst offenders for years, and I fear Servo will be no different. -- Anthony J. Bentley
Anthony J. Bentley writes:
Mark Galassi writes:
The result was dreadful: you use firefox and it immediately uses all RAM. Even a 1gig machine cannot work with current versions.
Yes, browsers are possibly the most apt example of Wirth’s Law in action.
Webkit was quite a bit lighter weight than firefox, and with Python bindings you can write a minimal browser in a few pages of Python code. For example, on a Debian-derived system, install python-webkit and look at /usr/share/doc/python-webkit/examples/browser.py. Here's how they compare on https://nmglug.org (after a fresh startup, no other tabs or URLs loaded): PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND 17197 1.9 3.4 264596 66320 pts/2 Sl 19:05 0:02 python /usr/share/doc/python-webkit/examples/browser.py 17222 36.6 8.9 624612 172764 tty1 Sl 19:07 0:13 firefox The comparison will be a lot less favorable if you use a full-featured webkit based browser, like chromium or konqueror. In other words, a lot of the memory footprint is the browser bells and whistles, not the underlying layout engine. I'm forever being tempted to write and maintain my own custom browser that way ... and then I remember how much I've invested into customized Firefox settings, noscript and cookie and other privacy profiles, etc. and I discard the idea. But for a quickie browser on an old low-power system, it might work fine, and would support all modern websites ... possibly better than firefox/gecko does. ...Akkana
participants (3)
-
Akkana Peck -
Anthony J. Bentley -
Mark Galassi