4 ms·
Now if only I could limit the amount of memory a browser would consume! The fact that desktop browsers grind a 16GB machine to a halt, while on mobile devices
by akrymski 4y ago
Now if only I could limit the amount of memory a browser would consume! The fact that desktop browsers grind a 16GB machine to a halt, while on mobile devices having 1000s of tabs is a non-issue is plain wrong. Since I can't limit a process' memory on Mac OS (any OS?), why not give me a setting in preferences to do so? After all the browser is really just a VM at this stage. I'm quite certain I don't need 100 tabs in active memory at once.
While at it, why can't we hibernate tabs? Write the JSC heap and DOM state to disk, the way VMs do it?
What's taking up the majority of my memory anyway - the graphics / gpu side or the JS VM?
There's a whole spectrum of startups trying to solve the webkit memory consumption issues crudely, such as https://www.mightyapp.com https://www.mightyapp.com
- pizlonator 4y agoI think that desktop browser users expect that their tabs generally won't get reloaded. On mobile, users have generally accepted that their tabs will get reloaded. Maybe browsers should just reload tabs if anything fishy happens or you're not using them. Hibernating tabs to disk is hard because the JS heap (and the DOM heap) will contain lots of stuff that is tied to handles you got from the OS. It's not impossible. But it would require a lot of work to build specialized serialization functions for stuff that has native state attached to it that the browser doesn't control or have good visibility into. I think that some websites use a lot of graphics memory while other websites use a lot of JS memory. And there are other categories of memory usage, too. Maybe if they put the cloud browsers on the blockchain using machine learning, and then write them in Rust and compile them to wasm, then it will be even better.
- akrymski 4y ago> I think that desktop browser users expect that their tabs generally won't get reloaded But they do get reloaded. There's absolutely no guarantee provided, and browser tabs will get swapped out of memory as necessary (eg opening lots of new tabs or apps). This is easily solvable though: let me pin tabs that I really need to persist.
- pizlonator 4y agoSure they do, but much less aggressively than mobile browsers. I think that desktop Safari will try to keep your tab live so long as nothing fishy happens. Based on my experiences using Chrome, it seems to do the same thing.
- tptacek 4y agoThis is a thread about an allocator design, not really about Webkit.
- akrymski 4y agoIt's also a thread about memory allocation in Webkit tho.