4 ms·
To be honest: I do not know. But given how fat most websites are today, I am not that surprised that so much memory is needed. Yes, there is still a major leap
by vaylian 7y ago
To be honest: I do not know. But given how fat most websites are today, I am not that surprised that so much memory is needed. Yes, there is still a major leap from a couple of megabytes to a full gigabyte, but with so many DOM nodes and JS objects I can imagine that even a resource-conservative browser will have trouble keeping memory usage low.
Or are there any browsers where you observe significantly less memory usage on the same websites? (Ignoring limited browsers like Lynx of course)
- ygra 7y agoMost modern browsers cache a lot of data in memory as well to make things like navigating back snappy and avoiding a full page re-load. It's also necessary to cache most of the state of the previous page to allow retaining form fields if you accidentally navigated away (as some forms are only in the DOM, created by JS, and not part of the original HTML). I believe to have read somewhere that at least Chrome listens to low-memory situations broadcast by the OS and will evict such caches. So while it uses a lot of memory as long as memory is available, it will also release much of it if necessary.
- PeCaN 7y agoThis makes sense but is somewhat annoying since a web browser is not the only program running on my computer (but apparently wants to be) and eats up RAM that could be used for the OS file cache. I wish there was some sort of allocation API specifically for allocating caches so that recently accessed files could kick out a web browser's cache of a not-so-recently accessed tab or vice versa.
- deleted 7y ago[deleted]
- nitrogen 7y agoPOSIX does have something sort of like this in madvise(), but I couldn't find a specific option for the semantics you described.
- bjoli 7y agoOn a low memory computer I had configured FF to not show images unless I alt-clicked them. Together with not using JavaScript this meant using significantly less memory. I suspect browsers still have to have raw bitmaps in memory, which for the 2mb jpegs you are fed everywhere quickly adds up...
- chmod775 7y agoThey have to be in memory somewhere. They technically don't have to be kept in RAM if they are uploaded to VRAM though. Assumining RGBA it's just over 8MB for a 1920x1080 image.
- gnode 7y agoImages could be kept compressed until they are painted. Most GPUs support texture compression, so don't need to keep a bitmap for compositing.
- chmod775 7y agoTexture compression is inherently lossy, so it isn't an option. It's also really dependend on your textures and what you want to do with them, you don't want browser to just go give it their best shot at compressing your company logo.