Disable background load of tabs

Description of the issue: As a ‘On Startup’ option I selected ‘Continue where you left off’. So now when I open the browser it opens the last tab where I left, and all the tabs that were opened are also in my sidebar. But I noticed that all the tabs are being loaded on startup, and if I have a good amount of tabs - it consumes a lot of RAM. Is there a setting/option that I can toggle in order to not load tabs that are not active, or were not activated by visiting them?
How can this issue be reproduced?

  1. Select ‘Continue were I left off’ as the Startup Up option
  2. Open a bunch of tabs
  3. Close the browsers completely (right click, quick)
  4. Open the browser

Expected result: Only active tab is being loaded, and all other tabs stays inactive.

Brave Version( check About Brave):
Version 1.63.174 Chromium: 122.0.6261.128 (Official Build) (arm64)

Additional Information: I’m curios if there is an option to toggle this, or if there’s an algorithm that decides when to do background loading or not. Any information will be useful, thanks!

1 Like

If there was an option in the Browser it would be near the Memory Saver section in Settings. It’s not there on either Brave or Chrome.

There used to be an extension called The Great Suspender which did something like what you want. I think it got sold and had tracking added to it, but if you search for “suspender” on the Chrome Web Store you’ll find a lot of copycats and similar extensions. I can’t find any which will suit you perfectly, but this one has an option to “suspend other tabs,” so you can get the desired result manually.

I tried last night to make an extension more suited to your use case - I have the same issue so it would be useful for me too. It mostly worked but not all the tabs were suspended so I’ll have to do some debugging when I find time. One thing I found though, was that you have to let the tabs load before they can be suspended, or you won’t have a title in the tab. So having a manual option to use after the tabs have loaded is not as lousy as it might seem.

High RAM consumption is not necessarily a bad thing. I’ve not tested how generous the browser is in surrendering RAM when other apps need it, but at times I’ve seen that nearly all my tabs are suspended, so it must be working. It might be better to bookmark tabs you’re unlikely to use rather than rely on the browser to suspend them or use an extension to induce that functionality.

1 Like

I agree that high RAM is not necessarily something that should worry me, especially if nothing else currently needs this RAM. I’m just curious how Brave chooses which tabs to unload and which to leave active. More a curiosity and a desire to know I can control it if it’ll be needed rather than a necessity. :slight_smile: Thanks for you response and work on the extension, appreciate it.

1 Like

I think a “lazy tab load” option would be great, I think that is what you were discussing.

I leave a ton of tabs open, that need to be restored. Ram usage isn’t as significant if the tabs, let’s say 50+, are all loaded on a session restore. It would be great ta have a setting that would only load tabs that are “active/have focus”. The startup hit to restore the tabs, really spins up my system. Once the tabs are loaded, my system spins down.

I think a “lazy tab load” would be a cool extension. I’ve never worked on a “Chromium” extension and would be interested in helping out.
Does Chromium force tab loading or is this something an extension could prevent from happening until the tab was in focus?

The startup hit to restore the tabs, really spins up my system.

Unfortunately this is essentially unavoidable.

I have an extension which Lazy-Loads new tabs by creating a data-uri which will redirect to the desired URL when the tab is focused, so my first plan was to capture tabs loading at startup and create a similar data-uri for each one rather than letting them load. As an example, this tab currently registers as 90Mb, whereas a data-uri from my extension is only 18Mb. But that plan didn’t work because programatically setting an existing tab’s url to a data-uri is prevented as a security policy.

An alternative to using a data-uri would be to have the tab load a page from the extension, and have that page load the proper URL when the tab is activated. However, this would not sync properly to a mobile device which doesn’t have the extension installed. It would also need a workaround to avoid data loss, because the tabs would be closed when the extension is updated.

Another way would be to store the titles and urls of the entire tab set every time a tab is opened, closed or navigated to a new url. This could be used to detect when tabs are being reloaded at startup, and each tab could be closed and replaced with a data-uri as mentioned above. But there’s a lot of complexity in this, and it would mean the user loses everything that was in the Back Button of each tab in the previous session.

So the only viable way to do it via an extension is to let each tab load, and then set them to be Discarded. If the CPU cycles of the loading tabs are an issue then the fix would have to be within the browser, not an extension. There’s already an issue raised, which you can Star: https://issues.chromium.org/issues/41483135

The algorithm I used in my extension is as follows:
When a tab is created with a status of “unloaded,” store its ID.
When a tab reaches a status of “complete” and its ID has been stored, suspend the tab.

Edit: here’s a bug report from 2022 which got ignored for so long it was closed, so don’t expect anything to happen on this issue. The reporter had 5971 tabs open in 3 windows!

1 Like

Thanks for the info.

I started looking around to see if someone had implemented something similar and came across a couple different extensions. The short of it is that this would need to be implemented in the browser itself, as you mentioned.

I’ll definitely track that issue. 5971 in 3 windows, that is browsing the Internet on hard mode.

The sloth extension, GitHub - hrj/sloth: Lazy load tabs in chromium, says it lazy loads, but that is not the case. The issue is that the browser does not wait for the extensions to completely load as mentioned here, Some tabs seem to remain active when there are hundreds of tabs open in a session · Issue #1 · hrj/sloth · GitHub, which is a reference to gorhill (ublock dev) posting a comment about extension loading, https://github.com/gorhill/uBlock/issues/2067#issuecomment-253583269

just off the startup of brave from the task manager as much as i know brave will start only when you open it and all the tabs too.
there is another way of doing this where you can put the tabs you use the most and frequently ‘pinned’ by right clicking on it and selecting pin tab which also minimizes it into a box which kinda looks minimal too. then go to setting and choose save memory by making inactive sleep this might help the app to focus on the pinned tab rather than the other ones and during the use the other tabs might be in sleep. note that sleep tabs might sometimes need refresh. also as a tip close the browser with the hometab selected.
let me know if this helped

I had another go at this, with a much less complicated method than what I outlined above. I had used something like this originally, but it didn’t work when the browser was continually closed and reopened, especially with the types of pages I was using - from a local webserver and the built-in downloads and history pages. In normal usage it’s actually almost perfect, and it doesn’t require tabs to be loaded before being suspended.

Now in the Chrome Web Store

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.