Skip to content

Applying a snapshot with hundreds of tabs loads a lot of them in active state rather than discarded #196

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

Closed
Keagel opened this issue Apr 12, 2020 · 10 comments

Comments

@Keagel
Copy link

Keagel commented Apr 12, 2020

Steps to reproduce

Apply a snapshot with hundreds of tabs

Expected behavior

Only active tabs at the time of the snapshot get loaded as active

Actual behavior

Randomly chosen (hundreds of) tabs get loaded as active rather than discarded, resulting in memory usage reaching 100%

Environment info

OS: win
Firefox version: 75
Addon version: 4.7.0

{ "settings": { "version": "4.7.0", "nativeScrollbars": false, "selWinScreenshots": true, "tabsCheck": true, "tabsFix": "notify", "ctxMenuNative": false, "autoHideCtxMenu": "none", "ctxMenuRenderInact": true, "navBarLayout": "vertical", "navBarInline": false, "hideAddBtn": false, "hideSettingsBtn": false, "navBtnCount": true, "hideEmptyPanels": true, "navMidClickAction": "none", "navSwitchPanelsWheel": true, "groupLayout": "grid", "dndTabAct": true, "dndTabActDelay": 750, "dndTabActMod": "none", "dndExp": "pointer", "dndExpDelay": 0, "dndExpMod": "none", "stateStorage": "global", "warnOnMultiTabClose": "collapsed", "activateOnMouseUp": false, "activateLastTabOnPanelSwitching": true, "skipEmptyPanels": false, "showTabRmBtn": true, "showTabCtx": true, "hideInact": false, "activateAfterClosing": "prev_act", "activateAfterClosingPrevRule": "visible", "activateAfterClosingNextRule": "tree", "activateAfterClosingGlobal": true, "activateAfterClosingNoFolded": false, "activateAfterClosingNoDiscarded": false, "shiftSelAct": true, "askNewBookmarkPlace": false, "tabsRmUndoNote": true, "nativeHighlight": false, "tabsUnreadMark": false, "moveNewTabPin": "start", "moveNewTabParent": "last_child", "moveNewTabParentActPanel": false, "moveNewTab": "end", "pinnedTabsPosition": "panel", "pinnedTabsList": false, "pinnedAutoGroup": true, "tabsTree": true, "groupOnOpen": true, "tabsTreeLimit": "none", "hideFoldedTabs": false, "autoFoldTabs": true, "autoFoldTabsExcept": "none", "autoExpandTabs": false, "rmChildTabs": "none", "tabsChildCount": true, "tabsLvlDots": false, "discardFolded": false, "discardFoldedDelay": 0, "discardFoldedDelayUnit": "sec", "tabsTreeBookmarks": true, "bookmarksPanel": true, "warnOnMultiBookmarkDelete": "collapsed", "openBookmarkNewTab": false, "midClickBookmark": "open_new_tab", "actMidClickTab": false, "autoCloseBookmarks": false, "autoRemoveOther": false, "highlightOpenBookmarks": false, "activateOpenBookmarkTab": false, "showBookmarkLen": false, "bookmarksRmUndoNote": true, "fontSize": "m", "bgNoise": true, "animations": true, "animationSpeed": "fast", "theme": "default", "style": "dark", "sidebarCSS": false, "groupCSS": false, "snapNotify": true, "snapExcludePrivate": false, "snapInterval": 1, "snapIntervalUnit": "hr", "snapLimit": 15, "snapLimitUnit": "day", "hScrollThroughPanels": false, "scrollThroughTabs": "none", "scrollThroughVisibleTabs": false, "scrollThroughTabsSkipDiscarded": false, "scrollThroughTabsExceptOverflow": true, "scrollThroughTabsCyclic": false, "tabDoubleClick": "none", "tabLongLeftClick": "none", "tabLongRightClick": "none", "tabsPanelLeftClickAction": "none", "tabsPanelDoubleClickAction": "tab", "tabsPanelRightClickAction": "menu", "tabsPanelMiddleClickAction": "tab", "syncName": "", "syncSaveSettings": false, "syncSaveCtxMenu": false, "syncSaveStyles": false, "syncAutoApply": false }, "permissions": { "allUrls": false, "tabHide": true, "actualAllUrls": false, "actualTabHide": true }, "storage": { "size": "34 mb", "props": { "containers_v4": "4.3 kb", "cssVars": "1.6 kb", "favAutoCleanTime": "10 b", "favUrls": "2 b", "favicons": "15.6 kb", "lastSnapTime": "13 b", "panelIndex": "1 b", "panels_v4": "1.7 kb", "prevTabsData_v4": "110.7 kb", "profileID": "14 b", "settings": "2.5 kb", "snapshots_v4": "33.7 mb", "tabsData_v4": "110.7 kb", "tabsTreeState": "2 b" } }, "panels": [ { "type": "bookmarks", "id": "bookmarks", "cookieStoreId": "bookmarks", "name": 9, "icon": "...", "bookmarks": true, "lockedPanel": false }, { "type": "default", "id": "firefox-default", "name": 7, "icon": "...", "cookieStoreId": "firefox-default", "lockedTabs": false, "lockedPanel": false, "noEmpty": false, "newTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true }, { "type": "tabs", "id": "1MUiat599GLE", "name": 8, "icon": "...", "color": "...", "customIconSrc": "", "customIcon": "", "lockedTabs": false, "lockedPanel": false, "noEmpty": false, "newTabCtx": "firefox-container-13", "moveTabCtx": "firefox-container-13", "moveTabCtxNoChild": false, "urlRulesActive": false, "urlRules": "" }, { "type": "tabs", "id": "wHdrIVoAqfPE", "name": 1, "icon": "...", "color": "...", "customIconSrc": "", "customIcon": "", "lockedTabs": false, "lockedPanel": false, "noEmpty": false, "newTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true, "urlRulesActive": false, "urlRules": "" }, { "type": "tabs", "id": "X3z3XFFW5dUE", "name": 4, "icon": "...", "color": "...", "customIconSrc": "", "customIcon": "", "lockedTabs": false, "lockedPanel": false, "noEmpty": false, "newTabCtx": "firefox-container-12", "moveTabCtx": "none", "moveTabCtxNoChild": true, "urlRulesActive": false, "urlRules": "" }, { "type": "tabs", "id": "d2NbDlJ3cJPE", "name": 7, "icon": "...", "color": "...", "customIconSrc": "", "customIcon": "", "lockedTabs": false, "lockedPanel": false, "noEmpty": false, "newTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true, "urlRulesActive": false, "urlRules": "" }, { "type": "tabs", "id": "Arc8fG-VS476", "name": 11, "icon": "...", "color": "...", "customIconSrc": "", "customIcon": "", "lockedTabs": false, "lockedPanel": false, "noEmpty": false, "newTabCtx": "none", "moveTabCtx": "none", "moveTabCtxNoChild": true, "urlRulesActive": false, "urlRules": "" } ], "cssVars": { "bg": "#0c0c0d" }, "windows": [ { "state": "maximized", "incognito": false, "tabsCount": 585 }, { "state": "maximized", "incognito": false, "tabsCount": 303 } ], "bookmarks": { "bookmarksCount": 113, "foldersCount": 18, "separatorsCount": 1, "maxDepth": 2 } }
@Keagel Keagel changed the title Applying a snapshot loads hundreds of tabs in active state rather than discarded Applying a snapshot with hundreds of tabs loads a lot of them in active state rather than discarded Apr 12, 2020
@mbnuqw
Copy link
Owner

mbnuqw commented Apr 12, 2020

Are these tabs containerized? Currently, Sidebery cannot open containerized tab in discarded mode because Firefox will open them in default container after restart - bug on bugzilla filled by me.

@Keagel
Copy link
Author

Keagel commented Apr 12, 2020

They indeed were containerized tabs, you're right. Seeing as that report is 7 months old I suppose the fix won't come any time soon.

What do you think about making it so that when you apply a snapshot, the containerized tabs load as active and immediately get discarded as soon as they're done? Might be a good idea to throttle the number of pages loading at the same time, what do you think? I suppose it's not really high priority as only users with a lot of tabs would be affected though.

@mbnuqw
Copy link
Owner

mbnuqw commented Apr 12, 2020

...load as active and immediately get discarded... - Nice idea! And it doesn't look too difficult to implement. Maybe I can even discard the loading tab before it get loaded. This would reduce the load of the cpu and time of this operation. I'll test this soon!

@Keagel
Copy link
Author

Keagel commented Apr 12, 2020

I'd think discarding it before it gets loaded would result in a blank page instead of keeping the previous state of the tab?

@mbnuqw
Copy link
Owner

mbnuqw commented Apr 12, 2020

Yeah, but I'll try to discard with some delay. Any way, I should test this.

@jathek
Copy link

jathek commented Apr 12, 2020

Might be a good idea to throttle the number of pages loading at the same time, what do you think? I suppose it's not really high priority as only users with a lot of tabs would be affected though.

I proposed progressive tab loading in #169. Sounds like it would help with your issue as well.

@mbnuqw
Copy link
Owner

mbnuqw commented Apr 13, 2020

@nearcatch, this feature, indeed, related in some ways (its actually the first thing I've though about), but it doesn't solve the high cpu and memory usage.

Also I've made some testing and found out that I can discard the new tab only after at least ~1 second after it completely loaded, which means that the process of opening the snapshot (with lots of containerized tabs) can be very slow.

But workaround exists! I can open special "blank" tabs instead of containerized and when user will activate them the url will be swapped back. Not very beautiful solution but until 1581872 will be fixed it can be used.

@Keagel
Copy link
Author

Keagel commented Apr 15, 2020

But workaround exists! I can open special "blank" tabs instead of containerized and when user will activate them the url will be swapped back. Not very beautiful solution but until 1581872 will be fixed it can be used.

Does that mean the tab won't be opened in the container it was previously in when the user activates it?

@mbnuqw
Copy link
Owner

mbnuqw commented Apr 15, 2020

All tabs will be opened in their own container. Video of the concept: https://gfycat.com/potableequatorialaustraliancattledog

@Keagel
Copy link
Author

Keagel commented Apr 15, 2020

That seems like a good workaround, certainly better than loading them all. After all, snapshots save tabs but not their content (things that were typed when it was discarded, etc.), right? So it achieves the same functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants