Live data from Hacker News

Ask HN: One tab on Chrome takes about 100MB memory, why?

news.ycombinator.com

141–150 of 210 posts

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#141
post #34

Earlier quoted context omitted.

I'm perfectly willing to wait a second for the page to be reloaded from solid-state storage, if I haven't visited the page for an hour or more. Some people might say I shouldn't keep hundreds of tabs open for weeks. But I'm an old guy, and by my standards my laptop is a freakin supercomputer, so in my mind it should be able to handle all the web pages I can manually throw at it.

Well chrome will "suspend" tabs when it sees your system is running low on memory, and will resume them when you switch to them. But it's a much harder problem to solve than many think. For example, if they start "suspending" my slack tab, or my email tab, and I begin missing messages I'm going to be quite upset...

Next step: Limit the amount of memory available to Chrome so it thinks your system is running low on memory earlier.

> I'm going to be quite upset...

You'll get over it, I promise.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#142
post #36
post #34

Earlier quoted context omitted.

I'm perfectly willing to wait a second for the page to be reloaded from solid-state storage, if I haven't visited the page for an hour or more. Some people might say I shouldn't keep hundreds of tabs open for weeks. But I'm an old guy, and by my standards my laptop is a freakin supercomputer, so in my mind it should be able to handle all the web pages I can manually throw at it.

As a person who also has way too manu tabs open at all times, I've had success with the great suspender [0]. It "suspends" pages after a timeout so they use less memory. [0]: https://chrome.google.com/webstore/detail/the-great-suspende...

At this point why not just use something like OneTab? It also syncs the tabs across many computers.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#143

Because it is 2018 and people have forgotten how to static HTML. All that lovely rendering code in your browser goes unused as people rewrite it in Javascript, badly; or even in C++ and then compile to web assembly, that’s all the rage now, because why stick with one layer of abstraction when you can involve three? Oh, and of course everyone rolls their own, so that website with the dancing pigs not only has its own…

Writing small footprint website helps, but the major culprit here is Google Chrome. It consumes way too much memory per tab (compared to Firefox on Linux), I've heard it's because it has a strict «one process per tab» policy, whereas Firefox has several processes but not one per tab.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#144
post #12

(I have worked as an engineer on both Ubuntu and Chrome) > One tab on chrome takes about 100MB memory, why? It probably doesn't. Much of that apparent memory usage is shared between all tabs, and the browser renderer process, etc. in the form of shared memory. Quite a bit of it will be the executable code itself, which is "mapped" into memory, given an address, and allocated the full size but doesn't actually consume…

If I Shift-Esc in Chrome with one tab open, it shows that this tab ("Add Comment") consumes 0 bytes of shared memory and 163 828 kB of private memory.

Current window size is 1280x800. Assuming the render buffer is ARGB32 and assuming one render buffer (which is probably an incorrect assumption) that should be ~40MB. The GPU memory is listed as a separate entry in that view, but I don't know if that is also included in the "private memory" listing.

Going turn off javascript and restart and see what it says then.

EDIT: 164 856 kB w/o JS. So no change (relatively).

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#145
post #83

Earlier quoted context omitted.

Sounds like your Firefox version is out of date. Multi process Firefox has landed quite a while ago, with different memory and performance characteristics.

I'll check. Guess Firefox copied this feature from Chrome.

Fortunately they didn't : they use one process for the browser UI, and a few (like two or four) processes for tabs which are dispatched between those process. It's way better than Chrome in term of memory consumption when you have lots of tabs opened.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#146

Hey. Hey. Chrome tabs are processes with shared memory, but they're still processes. On Linux, they get kernel space mapped in. That influences their total footprint even though it's shared. Can people just use what amounts of trifiling amounts of RAM in 2012 and stop demanding every executable be as "efficient" by an antiquated pre virtual memory metric, please? Chrome is astonishingly good at what it does.

I don't need every application to be the leanest that it can be. What I need is for every application stop assuming that 12 GB of free memory means that it's their 12 GB. I understand the adage of free memory being wasted memory, but there's a context for that adage. E.g. if a user clicks off of a tab, the browser doesn't need to write that tab's contents to disk when 12 GB is free. A good trade off is to store the t…

Free memory isn't wasted memory though, it's file system cache memory ! If a software uses 100% of the available RAM, it means all your file system call are going to be hard drive IOs (not everybody has ssd mate).

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#147

Because it is 2018 and people have forgotten how to static HTML. All that lovely rendering code in your browser goes unused as people rewrite it in Javascript, badly; or even in C++ and then compile to web assembly, that’s all the rage now, because why stick with one layer of abstraction when you can involve three? Oh, and of course everyone rolls their own, so that website with the dancing pigs not only has its own…

>The situation is no better on the server side, of course. Why write static HTML for your pageful of text when you can have a web framework pulling C++ from a SQL database, compiling it to web assembly on the fly and vomiting forth to the browser just in time

Any example of where something like this is actually used?

I'm also interested in hearing why browser rendering code goes unused when displaying a javascript-powered site.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#148

Because it is 2018 and people have forgotten how to static HTML. All that lovely rendering code in your browser goes unused as people rewrite it in Javascript, badly; or even in C++ and then compile to web assembly, that’s all the rage now, because why stick with one layer of abstraction when you can involve three? Oh, and of course everyone rolls their own, so that website with the dancing pigs not only has its own…

You're wrong. Empty page with no scripts still costs 100MB of ram.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#149
post #83

Earlier quoted context omitted.

Sounds like your Firefox version is out of date. Multi process Firefox has landed quite a while ago, with different memory and performance characteristics.

I'll check. Guess Firefox copied this feature from Chrome.

You don't have to guess - https://wiki.mozilla.org/Quantum

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#150

Earlier quoted context omitted.

Aww, come on. People want and expect websites to be very close to web applications that react to who you are, what actions you take on the page and a myriad of other factors. That's just not possible with static HTML.

I fundamentally disagree. I don’t think ‘people’ really do want that. That reminds me of the thinking during the 90’s and early 00’s that everyone somehow must want 10 browser toolbars that spam them with ads all the time.

Obviously, it depends on the site.

However, when you're on YouTube you don't want the site to suggest videos you're not interested in (or Amazon, products).

When you're on a blog, you don't want "related articles" to list articles you've already read.

Etc. Etc.

I don't know if people want this--in part because they don't even realize these features exist--but I'm sure the opposite can be annoying.

It also depends how modern techniques are used, but arguining that we have to go back to static HTML because it's better doesn't make sense to me.

Post reply on HN