Live data from Hacker News

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

news.ycombinator.com

31–40 of 210 posts

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

#31
post #22
post #19

Earlier quoted context omitted.

Yes, absolutely. I've had Chrome tabs take an inordinate amount of RAM and CPU and make the fans spin up. Enough so that other things were slow.

> inordinate amount of RAM and CPU and make the fans spin up I almost always find that this is caused by a badly behaved website, not Chrome itself. Some sites have horribly written JavaScript, or introduce ads that run their own CPU- and memory-intensive JavaScript. Finding and closing those tabs, or disabling JavaScript, or using uBlock or uMatrix usually solves it for me.

Chrome needs to handle a malicious web site. Chrome thus gets the blame when it fails to enforce proper resource limits.

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

#32
In modern days, it is usually a web page / app, who takes memory, not the browser environment itself.

E.g. I am developing a web photo editor https://www.Photopea.com . When you open large documents (dozens of layers in high resolution), it can use 4 GB of RAM or even more. That is simply because decompressed images are large. No matter what browser you use.

But I am still shocked about the memory requirements of some "modern" web apps. My app Photopea uses 80 MB after loading (with no documents open), because it has already loaded some brushes, patterns, gradients, shapes, and generated raster thumbnails for all of them.

GMail uses 280 MB right after loading. This is quite shocking, knowing that it should contain mostly text content.

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

#33
AFAIK, each tab in Chrome is a new process, rather than a thread. It's a lot easier to waste memory on duplicate stuff. The operating system will try to re-use as much memory as it can, but that's just a conservative guessing game.

I just opened 'example.com' 6 times in new tabs, and mapped out the memory of the new processes. Total memory size: 10GB. Resident set size: 427.28 MB. Private dirty rss: 104.23 MB. I did the same thing with two new pages & processes just to make sure: 3.3450 GB, 144.532 GB, 36.876 MB.

example.com is a tiny html page. So, yeah, I don't know what the hell it's doing with all that memory. I don't think the devs care how much memory they're using.

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

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

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

#35

There are several answers here: - Is 100 MB the marginal memory cost to add one more tab when you already have a bunch open, or is it the memory usage when you have a single tab open? Don't forget that there is a baseline amount of memory usage for the application itself. - Measuring memory usage is hard, doubly so for web browsers. You'd think it would just be about counting all the allocations, but shared libraries…

use the tool ps_mem.py which tells you both the 'private' memory and the 'resident' memory chrome used, those memory are indeed taken, not just malloc-ed in a VSZ area waiting to be used.

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

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

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

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

#37
post #14

Earlier quoted context omitted.

1 is entirely possible. Opera 12.x takes ~3-10MB per TAB (+the weight of the media used on the page). There is zero latency, opening new/switching tabs is instantaneous. Google devs use 16-32 core machines, often with hundreds of gigabytes ram. Why would they bother optimizing?

The standard machine has 32 GB. So I guess 0.32 hundreds... And for completeness, 6 physical cores, 12 logical with HT. Still beefy, but nothing out of the ordinary.

You are so wrong. Check here http://store.steampowered.com/hwsurvey/

these are gaming, most powerful PCs people are using. 8gb is 44% of all users.

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

#40

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.

My laptop has 8 GB of memory and I have to make sure to have no more than 4 or 5 Chrome tabs open when I use a VM.

You might instead use:

    --renderer-process-limit=4
Post reply on HN