Blank tabs in the background to conserve memory
Submitted by Tomeu Vizoso
If at any point during a browsing session a substantial number of tabs are loaded, there will be a good chunk of memory that cannot be returned to the OS because of fragmentation in the heap.
A way to put a reasonable limit to the memory used by the browser process during a long browsing session with typical tab usage is to limit the number of concurrent web views loaded at any given moment. That way, as tabs get loaded, they can reuse the empty blocks in the middle of the stack that were left by the background tabs that were unloaded.
As the user goes back to a tab that got unloaded, it will be loaded again automatically as we already do now when activating for the first time a tab loaded from a previous session.
The patch currently attached applies to the 3.8 branch and only works with WebKit1, as the WebKit2 API doesn't have yet a way to query the HTTP method of a frame.
I'm only posting this as a RFC, and if this is something that maintainers feel is worth having upstream, I can port it to WebKit2 and master.