6 ms·
> There is no upside to using more memory. Sure there is. Most complex systems can trade-off between memory usage and CPU. With more memory, the garbage collec
by kentonv 8y ago
> There is no upside to using more memory.
Sure there is. Most complex systems can trade-off between memory usage and CPU. With more memory, the garbage collector doesn't have to work as hard, caches stay warm, etc.
> You don't know what a given system has for memory,
Chrome knows how much memory is available on your system, and it adapts its own memory usage based on this.
V8 is designed to push the garbage collector harder when memory usage is tighter -- reducing usage at the cost of JavaScript running a little slower.
I believe Chrome is also capable of freezing entire background tab states and saving them to disk, to be restored later when you go back to the tab. But there's no reason for it to do that if you have plenty of RAM to spare.
- User23 8y agohttps://en.m.wikipedia.org/wiki/Space–time_tradeoff https://en.m.wikipedia.org/wiki/Space–time_tradeoff Google focuses very strongly on time, so I’m unsurprised that they are willing to trade space for time. Of course it’s possible Chrome is also outright wasting space, time, or both, but I have no idea if it is to a nontrivial extent.
- xg15 8y agoBut maybe I'd like to execute some other programs in addition to Chrome as well. So this might result in unneeded memory pressure in other programs.
- BuckRogers 8y agoThat's why you don't use garbage collection. Wasm or static pages only. V8 has been the worst thing to happen to the web, it made JS moderately performant. That's a terrible thing, now we have all this additional complexity thanks to Google's attempt to make the web an appstore.