Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected load #4

Open
grahamperrin opened this issue Sep 4, 2019 · 8 comments
Open

Unexpected load #4

grahamperrin opened this issue Sep 4, 2019 · 8 comments
Labels
help wanted Need help from community optimization research Issue requires further research

Comments

@grahamperrin
Copy link

If tabs are not loaded prior to merge, they should remain not loaded after the merge.

Thanks

@Zegnat Zegnat added optimization research Issue requires further research labels Sep 4, 2019
@Zegnat Zegnat self-assigned this Sep 4, 2019
@Zegnat
Copy link
Owner

Zegnat commented Sep 4, 2019

This will need some research. Currently I simply ask the browser to move the tabs from one window to another. It may be a limitation of the browser extension API that wakes them all up.

It may need something like how pinned tabs are handled: where we first need to check the load status for all tabs, and after moving them to a different window reset that status. That would not fully fix the issue though, as tabs may still try and load at the moment of moving.

@grahamperrin
Copy link
Author

Thanks.

If it helps: extensions such as Tab Mover can move a tab without loading it.

@Zegnat
Copy link
Owner

Zegnat commented Sep 5, 2019

That is interesting, seeing how both addons run essentially the same code. Mine:

browser.tabs.move(tabs.map(tab => tab.id), { windowId: target, index: -1 })

Tab Mover (background.js lines 35–36):

    browser.tabs.move(selectedTabs.map(selectedTab => selectedTab.id),
            {windowId: targetWindowId, index: -1});

Likely something in the pre- or post-processing I do that triggers tabs to load then.

Question: did you see this with just random tabs or with pinned tabs in particular? Pinned tabs cannot be moved without unpinning them and then pinning them again. This is just one type of processing I do that Tab Mover does not do.

@grahamperrin
Copy link
Author

Thanks

AFAICT version 0.4.0:

  • behaves as expected with unloaded tabs in Waterfox Classic 2019.10
  • does not behave as expected with discarded tabs in Firefox 71.0.

Using Auto Tab Discard for test purposes, to manually discard a tab in a multi-tabbed window, before merging all tabs from that window into a different window.

@Zegnat Zegnat removed their assignment Oct 9, 2020
@shodanx2
Copy link

Hello !

I am experiencing the same issue.

Running
Firefox 122.0.1 on windows 10
Window Merger 0.6.0

After a fresh reboot, I opened firefox
I had 1392 tabs and about a dozen open windows
Firefox only loaded the currently displayed tab on each window
cpu and memory usage stable

When using the "merge all windows into this one"

This happens

image

then you wait a long time (5-10 minutes),

All browser function appear frozen

I tried using Stop All Button addon button, it had no effect

the computer gets tired and this happens

image

I tried using LoadTabOnSelect 3, which prevents tabs from loading in the background. It had no effect

I also tried an alternative addon Merge Windows, it was much slower to merge the windows and still awoke all the tabs !

@shodanx2
Copy link

NOTE :
I have noticed that the "group by domain" function of addon "order by domain

image

https://github.com/doriantaylor/w3x-taborder

Can move large numbers of tabs (many hundreds), without trigger this problem.

I have also noticed that the merge window problem of high load, does not always happen, and it more likely to happen when the system is already at high load. Possibly a few tabs get woken up by the move (possibly just one tab per window, but over 20+ windows) and this might trigger a memory saving features which pushes the system over the edge.

@Zegnat
Copy link
Owner

Zegnat commented Mar 18, 2024

I just checked the code used by the tab reorder add-on, and it uses the exact same code as Window Merger as well as the previously mentioned Tab Mover.

Order Tabs by Domain (main.js line 87):

let p = browser.tabs.move(id, spec);

The only difference between my add-on and the reorder add-on is that tabs are moved between windows. Which may make a difference, but if it does, it seems to be undocumented by Mozilla. We simply use the move API as the browser makes it available. I was really hoping they might be doing something different so I would have had something to go on.

If anyone know a good way to track and log tab states, maybe through an additional add-on, I would love to check it out. Another thing that might help is if we can figure out a minimal reproduction case that does not require someone to have 20 windows with 30 tabs each to max out their memory first. It might just be that I need to file a bug with Mozilla, but would like to have a reproduction ready.

@Zegnat Zegnat added the help wanted Need help from community label Mar 18, 2024
@Zegnat
Copy link
Owner

Zegnat commented Oct 5, 2024

I finally ran into this problem myself. But seemingly only because I am testing out Zen Browser (currently version 1.0.1-a.7) where I saw a bunch of tabs get activated after move. These tabs were discarded by the browser itself, not manually using Discard Tab (GitHub). The usual add-on I use to discard memory heavy tabs. So I am not sure I can emulate the issue even there.

Revisiting this also got me to realise that the previously mentioned Order Tabs (GitHub) might be suffering from the same issue. I am guessing that seemingly random trigger of this problem is why @shodanx2 might not have seen it happen (yet). See:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Need help from community optimization research Issue requires further research
Projects
None yet
Development

No branches or pull requests

3 participants