Live data from Hacker News

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

news.ycombinator.com

81–90 of 210 posts

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

#81
Well, here is one thing I observed.

Chrome allocates different process for every tab. Firefox doesn't do that. Just one process for all tab.

Suppose I open 10 tabs each on Chrome & Firefox. And suppose every tab needs 100MB of memory.

If you look up in task manager -

Chrome - 10 tabs - 10 different process - 100MB each = 1000MB = roughly 1GB

Firefox - 10 tabs - only 1 process - 1000MB = roughly 1GB for that one process.

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

#82

I'm eager for info too. But while we're waiting, I have a genuine, not snarky, question too: does this ever actually negatively impact people's use of their computer? I can't recall ever feeling like my browser having lots of tabs open has changed the experience. RAM and resource usage hasn't been on my mind in years.

Yes, I have a noisy fan and if the browser makes it turn on it's distracting.

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

#83

Well, here is one thing I observed. Chrome allocates different process for every tab. Firefox doesn't do that. Just one process for all tab. Suppose I open 10 tabs each on Chrome & Firefox. And suppose every tab needs 100MB of memory. If you look up in task manager - Chrome - 10 tabs - 10 different process - 100MB each = 1000MB = roughly 1GB Firefox - 10 tabs - only 1 process - 1000MB = roughly 1GB for that one proce…

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

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

#84
post #34
post #4

> One tab on chrome takes about 100MB memory, why? Two reasons 1) Because, Chrome is ready to do something with that tab: browse the web. Do this, create a browser that doesn't use much memory when a tab is idle. Switch back to that tab and interact with the page or go to a new page. You will experience latency. It will feel slow. That's why the tab uses a lot of memory. It is staying ready at all times to be interac…

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.

> I'm perfectly willing to wait a second

I'm not. I open dozens of pages simultaneously routinely. 1 second here, one second there, it adds up.

Sure, it's not the end of the world, but those differences were why Chrome was better than Firefox.

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

#85
post #30

I'm eager for info too. But while we're waiting, I have a genuine, not snarky, question too: does this ever actually negatively impact people's use of their computer? I can't recall ever feeling like my browser having lots of tabs open has changed the experience. RAM and resource usage hasn't been on my mind in years.

Yes indeed. My computer at work has 16 GB. It gets slow. Every now and then, I'll open a web page that pushes things past a limit. The browser becomes completely unresponsive and sometimes I can't even move my mouse. While I'm suffering from running out of memory, the browser decides to use up even more memory to pop up a dialog to taunt me about it. This can even happen without user action, for example when a page a…

I don't think X11 has anything to do with this. You should set ulimit for the browsers.

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

#86
post #80

Earlier quoted context omitted.

Yes, they don't offer that on their laptops, but what the OP is talking about is a desktop machine. Apple definitely offers 32 GB in their desktops.

OP is talking about the machines Google devs use, and I am betting they are definitely not desktop machines.

He was describing the standard desktop workstation at Google.

My understanding is that they have rMBP laptops and slightly beefier desktops.

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

#87
To my overly long TODO-list I added a web browser project. I would like to see something akin to Links [0] or Lynx [1] with a bit of Dillo [2], but also for mobile.

Features & non-features:

- it would generally work like the reader mode (no other modes) trying to place navigation links in a predictable place

- user can easily select text size and color schemes

- night mode (Android does not have one)

- because of it's content focus it could offer great offline capabilities like full-text search through archive and version comparison

- probably ignore most or all CSS

- probably no JavaScript support

- ad blocker for the rest

Can such a thing use it's own rendering engine on iOS? As I said I don't care about JS.

[0] https://en.wikipedia.org/wiki/Links_(web_browser)

[1] https://en.wikipedia.org/wiki/Lynx_(web_browser)

[2] https://en.wikipedia.org/wiki/Dillo

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

#88

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 tab in memory, for X minutes. Write the tab (or more simply, the URL) to disk after those X minutes have elapsed.

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

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

> I'm perfectly willing to wait a second I'm not. I open dozens of pages simultaneously routinely. 1 second here, one second there, it adds up. Sure, it's not the end of the world, but those differences were why Chrome was better than Firefox.

You cut off the "if I haven't touched the tab in an hour" part.

How many times does that pretty-narrow situation happen to you in a day?

If you had such a memory-saving mechanism, boosted by prefetching the tabs adjacent to my current tab, it would barely cost me any seconds in an average week. Running low on memory is a big hassle taking a lot of seconds to deal with.

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

#90
post #66

Earlier quoted context omitted.

Applications should use all available RAM they practically can for things like cache. Ideally they will hold on to it lightly so other applications can take what they need. Entirely unused RAM is a waste if never used.

The OS should use all available RAM it practically can for things like cache. Not the applications.

That may not actually be a practical approach to the problem. Years (and jobs) ago, we rolled significant caching into Vegas (video editor), allowing the app to take up 8GB of RAM in cached frames, even on 32-bit builds. There was no way for the OS to do this sort of work for us. The best that the operating system would have been able to do would have been to cache file reads for us.

Caching the output of computation was incredibly valuable to our customers, and the caching that the OS would have done would have had little to no benefit to our customers.

The same could be said for Chrome. Maybe there is value to a globally coordinated OS caching manager, but the OS shouldn't have sole responsibility for caching. Such an approach is clearly suboptimal for the user in at least one use-case (see example above).

Post reply on HN