Open Ambrevar opened 5 years ago
I think Firefox/Chrome in Mobile System do something similar.
As user call an early opened tab it has to reload it all again, as if that tab was "dead" and firefox only kept their URI.
Looking forward!
I thought that loading about:blank
in the buffer could lessen the RAM footprint, as all the JavaScript handling will basically disappear. I even implemented a prototype, to no avail -- RAM usage was more or less the same, when loading about:blank
into dormant buffers.
There are several other ways that could work for RAM preservation:
follow-hint-new-buffer
after 426b55d96849c137d8cca5b0aedf28619a1ce1ec, greatly reducing the RAM for buffers that were opened but not-yet-accessed. However, it's a solution that could only work in some special cases, like opening a ton of new buffers.
One of the biggest flaws that plagues modern browsers is how much memory they eat. Users tend to leave dozens of tabs open until the system runs out of memory. Users should not have to worry about that. Next could be different here.
The idea is to automatically unload the old buffer webviews from memory, only reloading them on demand. Buffers would be unloaded after a threshold is reached, e.g. after some amount of memory has been alocated, or some number of buffers is used.
This way the user could easily have hundred of buffers, while only some 20-30 of them are loaded.
This brings up the concept of "live buffers" vs. "dead buffers". A dead buffers only takes a couple of KiB in memory, while a live buffer, well, probably a couple of MiB. In order to restore a dead buffer to its previous state, we need to collect some informaton:
Of course not all buffers can be reloaded into the same state. For instance some HTML5 video players or games may not support this. For this reason, I suggest we leave it to the user to customize their "whitelist" of URLs that ought not to be unloaded.
Once this is implemented, #365 could store "dead buffers" instead of only the (name title) pairs.