News for hackers. Stuff that matters.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by glibgil on Saturday March 10, 2018 @06:46PM (#16560747)
> 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 interacted with by the user and the network.

2) The real reason: Chrome either has no memory budget or the memory budget was set to 100 MB. The engineers decided that some amount of memory usage was acceptable and that's what you get. If a new budget was created, say 10 MB, then what you would see is some very clever engineering to overcome the problems in the first reason I gave. Chrome would be responsive at all times and use very little memory per tab, but at great engineering cost. It would be very difficult, but interesting work.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by DennisP on Saturday March 10, 2018 @08:23PM (#16561157)
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? by vageli on Saturday March 10, 2018 @08:41PM (#16561225)
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? by LordDragonfang on Sunday March 11, 2018 @04:56AM (#16562250)
The current version also has a bug where it will create so many cookies on google-owned domains that it will exceed the header limit and cause a 500 response. The dev refuses to fix it until he implements a feature to make suspended tabs persist across updates, which is apparently slow going.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by imhoguy on Sunday March 11, 2018 @05:30AM (#16562315)
Well, it is opensource so anyone can fix it for fun or profit: https://github.com/deanoemcke/thegreatsuspender
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by TheOtherHobbes on Sunday March 11, 2018 @04:52AM (#16562243)
Seconded. I reliably have a few hundred tabs open, and GS keeps them all manageable.

It’s not always happy if Chrome crashes or I have to do a cold reboot, but mostly it keeps Chrome’s gluttony under control.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by EGreg on Sunday March 11, 2018 @08:06AM (#16562678)
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? by Klathmon on Saturday March 10, 2018 @10:51PM (#16561611)
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...

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by mkl on Sunday March 11, 2018 @12:23AM (#16561813)
That doesn't sound like a reason for it to be hard - just provide a way to mark tabs as "don't suspend". I have only a couple I would put in that category, and I really wish Chrome would stop burning up all my resources and battery on the rest (often it's not a specific tab, just the "Browser" process, so I can't do it manually).
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by askmike on Sunday March 11, 2018 @12:37AM (#16561834)
I'm pretty sure the amount of users that actually like this opt-out behaviour (everything gets suspended by default) is a minority.

Instead what they choose to do is not worry about memory until it you actually run out of it. I don't mind my applications taking up 90% of my memory if that keeps everything fast and I don't have to worry about keeping track and thinking about what I actually want to suspend and what I dont't.

If you really do mind, just run any of the plugins that implements your exact required behaviour (like the great suspender).

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by tinus_hn on Sunday March 11, 2018 @08:00AM (#16562662)
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? by Klathmon on Sunday March 11, 2018 @10:10AM (#16563059)
I'd just end up using another browser that doesn't purposely slow itself down or make me miss notifications or stop background activity unnecessarily.

Why the extreme majority would want that from their browser all the time baffles me. Just to see a lower number in a resource monitor window?

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by MrMid on Sunday March 11, 2018 @08:31AM (#16562746)
Firefox keeps alive pinned tabs, don't know about chrome
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by TheSpiceIsLife on Sunday March 11, 2018 @05:47AM (#16562360)
If one tab uses about 100MB of memory then does two hundred tabs use 20GB of RAM?

You say you sometimes have "hundreds" of tabs open, I've done this too, but my laptop doesn't have 20GB of RAM, but it just seems to work anyway.

What I ended up doing was: just stop looking at resource monitors.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by DennisP on Sunday March 11, 2018 @09:53AM (#16562990)
I don't know but it eventually bogs down the computer. Fan starts running hard and everything's slow until I close down a bunch of tabs.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by epigramx on Sunday March 11, 2018 @01:11AM (#16561897)
> 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? by Dylan16807 on Sunday March 11, 2018 @01:34AM (#16561934)
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? by qrbLPHiKpiux on Sunday March 11, 2018 @04:10AM (#16562154)
That one second makes me want to smash my device to pieces.
[dead]
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by teh_klev on Sunday March 11, 2018 @04:42AM (#16562227)
And stop being quite so snarky to users who may not know about these hidden settings.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by akulbe on Saturday March 10, 2018 @07:14PM (#16560881)
Another implied solution perhaps... don't use so many tabs? (I promise you, I'm speaking to myself as I say that. I use way too many, myself)
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by lev99 on Saturday March 10, 2018 @09:04PM (#16561312)
I'm currently at 30 Firefox tabs and it's using 1.24gb of memory. Much less than 100mb/tab.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by chalupa-man on Saturday March 10, 2018 @10:04PM (#16561502)
Firefox recently switched to a design that tends towards a higher base memory usage than Chrome, but a lower usage for each new tab. With the same 30 tabs open and no extensions, the current Firefox uses ~30% less memory than Chrome. But opened only to one tab, Chrome uses ~60% less memory than Firefox. It's an interesting tradeoff.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by rasz on Saturday March 10, 2018 @07:13PM (#16560872)
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?

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by bsimpson on Saturday March 10, 2018 @10:31PM (#16561566)
FWIW, I'm a Google dev and my only computer is the same 2015 15" MacBook Pro that many of the people reading this have had. Anecdotally, most of the developers I see are in the same boat (using a rMBP as their primary machine).

Many of the folks who work in our monorepo have an additional Linux workstation - not sure what the specs are on it, or what the average split is between laptop and workstation surfing. I also haven't paid that much attention to see if the folks I know on the Chrome team have substantially different usage.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by toephu2 on Saturday March 10, 2018 @11:30PM (#16561700)
>Google devs use 16-32 core machines, often with hundreds of gigabytes ram

You obviously have no idea what you are talking about. Most devs at Google use MacBook Pros.. which cannot even be upgraded to hold hundreds of gigs of ram.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by mattlondon on Sunday March 11, 2018 @05:28AM (#16562313)
The standard setup is a Linux desktop workstation - typically 6-8 core and 32-64gig ram depending on age (although there are some special set ups).

The required build tools and software for the internal engineering systems aren't usually available on a Mac so you'll need to have a Linux machine (physical or virtual) somewhere to remote into to do any dev work (again some teams are different but the bulk of engineers use the centralised Google infrastructure for source control, builds etc)

In addition to the desktop, every engineer gets a choice of laptop (Mac/windows/Chromebook) as well for email, meetings and cat videos.

Non-engineering just get a single laptop. Many many people now pick to use Chromebooks.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by quicklime on Sunday March 11, 2018 @03:06AM (#16561997)
Chrome devs are given both a laptop (most choose a MacBook Pro) and a fairly beefy desktop. My one had 64G of RAM, and that was given to me six years ago.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by srtjstjsj on Sunday March 11, 2018 @03:31AM (#16562053)
Are those 64GB for browsing the web as parent poster claims, or for compiling software, leaving much less for web browsing?
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by wruza on Sunday March 11, 2018 @04:41AM (#16562226)
Did you know that it remains free when you’re not compiling in a moment?
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by dgquintas on Saturday March 10, 2018 @07:45PM (#16561003)
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.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by Blindedwino on Saturday March 10, 2018 @08:07PM (#16561102)
I would venture to say that most of the world isn't using computers with 32GB RAM...
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by meuk on Sunday March 11, 2018 @03:48AM (#16562103)
I consider 2GB acceptable, 4GB normal, and 8GB high-end (maybe even overkill).
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by golergka on Sunday March 11, 2018 @05:39AM (#16562338)
Strange, that's the metric I personally used around 2008. Haven't ran into a computer with less than 16GB for the last few years.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by oblio on Sunday March 11, 2018 @07:52AM (#16562648)
A rather popular hardware site in a developing country, but one on the upper range of "developing". So probably better off than 60% of the world's population:

399 laptops with 4GB of RAM: https://www.pcgarage.ro/notebook-laptop/filtre/memorie-capac...

548 laptops with 8GB of RAM: https://www.pcgarage.ro/notebook-laptop/filtre/memorie-capac...

Less than 200 laptops, in total, with 16GB RAM or more. So probably less than 20% of the laptops on sale have that much memory, in 2018.

The "real" world is quite different to what us folks in IT see in our corner of the world.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by Macha on Sunday March 11, 2018 @06:30AM (#16562466)
8GB is still a pretty common setup

* Literally every current MacBook except the 15" MBP

* iMacs unless you choose to upgrade the RAM

* My local PC retailers website has 34 models with 4GB of RAM, 84 with 8GB and 28 with 16GB. The cheapest 16gb laptop there is €1100. They also sell 3 Chromebooks and 1 windows 10 device with 2GB of RAM..

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by foepys on Sunday March 11, 2018 @12:01AM (#16561771)
Especially since 32GB DDR4 RAM currently cost ~$350.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by Dolores12 on Saturday March 10, 2018 @08:42PM (#16561226)
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? by cpcallen on Saturday March 10, 2018 @09:17PM (#16561369)
I believe dgquintas is describing the standard engineering workstation at Google.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by konart on Sunday March 11, 2018 @03:08AM (#16562002)
>most powerful PCs people are using

No, workstations and\or graphical stations are powerfull. Gaming rigs can be powerfull, but most of the time they are average or just above average.

Also - steam statistic will show you a great number of PCs that are being used only to play some indie games and\or Dota. 8gb is more than enough for that.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by lbotos on Saturday March 10, 2018 @09:18PM (#16561372)
Depends on how you define "power". I'm sure devs often have more RAM for VMs etc, where gamers have more GPU for graphics. I'm building a gaming rig right now, the games I wanna play 8GB of RAM is plenty.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by brokenmachine on Monday March 12, 2018 @12:53AM (#16566287)
But if you click on the RAM section, 40% have 12gb or more.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by dgquintas on Sunday March 11, 2018 @04:27AM (#16562192)
yeah, sorry, I was referring specifically to the Google developer standard workstations.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by netheril96 on Saturday March 10, 2018 @09:18PM (#16561377)
Batch reply to the other comments: the "standard machine" here refers to what Google developers are using.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by megaman22 on Saturday March 10, 2018 @09:16PM (#16561367)
Are you talking standard Google developer workstation specs? That's not much different than the thinkservers we use as desktops. But considerably beefier than what non-desktop devs might be accustomed to.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by vonseel on Sunday March 11, 2018 @03:35AM (#16562062)
Surely 16Gb was more common at least until recently? Haven’t seen many 32gb ram mbp in the wild. Actually, I’ve never seen one.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by lev99 on Saturday March 10, 2018 @09:01PM (#16561298)
Apple doesn't even offer a 32GB option for their Macbook Pro computers. 32gb is far from standard.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by darrenkopp on Saturday March 10, 2018 @11:32PM (#16561703)
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.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by askmike on Sunday March 11, 2018 @12:43AM (#16561846)
OP is talking about the machines Google devs use, and I am betting they are definitely not desktop machines.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by chaboud on Sunday March 11, 2018 @01:28AM (#16561924)
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? by dgquintas on Sunday March 11, 2018 @04:28AM (#16562194)
some people have macs, some other people have thinkpads (at other points in time, there have been dells or HPs as well). But only desktops are actually used for any development.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by dgquintas on Sunday March 11, 2018 @04:29AM (#16562196)
they are desktop machines.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by IncRnd on Saturday March 10, 2018 @10:33PM (#16561569)
320 = 3.2 hundreds not .32 hundreds. 3 hundreds, 2 tens, and 0 ones.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by 64738 on Saturday March 10, 2018 @11:44PM (#16561738)
But, he said 32 GB, not 320, so it would be 0.32 hundreds.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by IncRnd on Sunday March 11, 2018 @05:15PM (#16564837)
Right. What do you get when you divide 32GB by 100MB per tab. It's not .32 hundreds. It is 3.2 hundreds.

> The standard machine has 32 GB. So I guess 0.32 hundreds

His comment was in response to Opera 12.x takes ~3-10MB per TAB (+the weight of the media used on the page).

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by SquareWheel on Saturday March 10, 2018 @11:29PM (#16561696)
>Why would they bother optimizing?

Because they're also targeting Android devices.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by Feniks on Sunday March 11, 2018 @10:10AM (#16563060)
This incidentally is why I chose a OnePlus: for its 6Gb of RAM.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by DennisAleynikov on Saturday March 10, 2018 @07:39PM (#16560980)
this is supposed to be exaggerated but who the fuck uses a 32 core computer with hundreds for gigabytes of ram. Do you mean their data centers?
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by taspeotis on Saturday March 10, 2018 @07:41PM (#16560988)
The numbers might be slightly exaggerated. Nonetheless, they’re high-end machines.

https://randomascii.wordpress.com/2017/07/09/24-core-cpu-and...

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by jjuhl on Sunday March 11, 2018 @07:13AM (#16562564)
My dev workstation at work has 20 Xeon cores w/ HT (so 40 threads), 64GB RAM and a 1TB NVME SSD. All that hardware sees plenty of use when compiling large C++ applications.

My home machine has 4 i7 cores w/ HT, 32GB RAM & a 1TB SSD. Compiling stuff on that one is ok, although quite a bit slower.

Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by IncRnd on Saturday March 10, 2018 @10:36PM (#16561578)
My desktop has 128 GB with 32 cores.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by KindOne on Saturday March 10, 2018 @10:39PM (#16561580)
What CPU/mobo you using?
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by IncRnd on Saturday March 10, 2018 @10:50PM (#16561607)
The one I mentioned is a precision w/ 2x2680. These dropped in price and flooded the market after leases finished. There are too many problems and finicky nonsense with adding extra video cards (due to the power supply). I also have an HP w/ 2x2680v2 128GB on the way. Using the HP I'll be able use for some projects a few of the old nanos and 295x2s I have sitting around. These are so cheap now.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by KindOne on Saturday March 10, 2018 @11:35PM (#16561712)
Reminds me of this, https://medium.com/@timgasser/build-a-16-core-128gb-server-f... Looks like from supply and demand those prices increased a bit.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by IncRnd on Sunday March 11, 2018 @05:08PM (#16564789)
It's more expensive to build one than to buy one, which is why I said I bought some off lease. I've bought systems not (generally higher priced) parts that were scavenged or not sold.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by KindOne on Sunday March 11, 2018 @10:17PM (#16565816)
I had misread that, thanks.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by gravypod on Sunday March 11, 2018 @09:25AM (#16562874)
Do you have any model numbers or suggestions as to where to buy this sort of stuff? I want to get (always wanted really) a dev server for home.
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by IncRnd on Sunday March 11, 2018 @05:06PM (#16564780)
Re:Ask HN: One tab on Chrome takes about 100MB memory, why? by amzn_82582 on Sunday March 11, 2018 @03:06AM (#16561995)
Most amazon employees now use ec2 instances as their development environment so using a x1e.32xlarge with 128 vCPU's (64 cores over 4 sockets), 3,904 GiB of memory, 2 x 1,920 NVMe GB drives, and 14,000 Mbps of EBS bandwidth is possible.

Granted, I don't know anyone that uses that much and you would probably get asked by management for using a dev desktop that big but you can if you need to. I myself use just a i3.xlarge with 4 vCPU's, 30.5 or memory, Up to 10 Gigabit of EBS storage and 1 x 0.95 NVMe SSD.