Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Tabs which start at about: urls (like new tab) won't ever be automatically discarded #13547

Closed
petemill opened this issue Mar 21, 2018 · 1 comment
Assignees
Labels

Comments

@petemill
Copy link
Member

petemill commented Mar 21, 2018

#13120 fixes and re-introduces tab discarding, with the same logic as previous:

  • If a tab is created with an about url, even about:newtab, then we set autoDiscardable: false in createProperties.
    The problem here is that some or many or most user tabs will be created with the starting url of about:newtab or about:blank, which will render the tab discarding feature much less useful if this logic remains.

The difficulty to reproduce this is what led to this becoming a hidden bug until now: We created a manual tab discard debug option, which is not impacted by this logic. Automatic tab discarding is affected, and is the purpose of the tab discarding feature.

I will add a logging flag in a potential fix in order to observe when a tab has been discarded.

Test plan / Steps to Reproduce

It is very difficult to reproduce, since one must reproduce with the same conditions neccessary to force the underlying browser to delete a tab's contents due to memory pressure. I have had some luck with the following, on a Windows VM allocated a smaller amount of memory than usual:

  1. Create a new tab (starting at the default about:newtab homepage)
  2. Cause memory pressure (create many many new tabs, with many open apps, and make those tabs active 1 by 1, rapidly)

Actual result:

Tab is not discarded (does not reload when visited)

Expected result:
Tab is discarded when not active for some time (reloads when visited). Unfortunately we do not have the equivalent of chrome://discards to observe when a tab has been automatically discarded.

Reproduces how often:

Brave Version

about:brave info:
0.22.x / master

Potential Solutions

  1. Call webContents.setAutoDiscardable(bool) when navigation to a new URL is complete, and follow existing isHttpOrHttps || pinned logic.
  2. Allow tabs which start at about:... URLs to be auto discardable. (but what about pinned vs non-pinnned?)
@petemill petemill added the 0.22.x issue first seen in 0.22.x label Mar 21, 2018
@petemill petemill added this to the 0.22.x (Beta Channel) milestone Mar 21, 2018
@petemill petemill self-assigned this Mar 21, 2018
@petemill petemill changed the title Tabs which begin with about: urls won't ever be automatically discarded Tabs which start at about: urls (like new tab) won't ever be automatically discarded Mar 21, 2018
petemill added a commit to petemill/browser-laptop that referenced this issue Mar 22, 2018
Fix faulty logic that would almost never have a tab become discarded automatically.
Fix brave#13547
@bsclifton
Copy link
Member

Marked as QA/no-qa-needed because the test plan would be the same as regular tab discarding (but for about pages)

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

No branches or pull requests

2 participants