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

Discard active tab if memory exceeds XXX #383

Open
AJolly opened this issue Jul 20, 2024 · 2 comments
Open

Discard active tab if memory exceeds XXX #383

AJolly opened this issue Jul 20, 2024 · 2 comments

Comments

@AJolly
Copy link

AJolly commented Jul 20, 2024

It'd be really useful to be able to discard active tabs if the memory reaches a certain level, not just background tabs.
I frequently have lots of "active tabs", but not active windows, if that makes sense.

@Chealer
Copy link

Chealer commented Jul 21, 2024

Please clarify what you mean by "the memory reaches a certain level".

@AJolly
Copy link
Author

AJolly commented Jul 21, 2024

The existing feature in number.mjs:

It doesn't seem to trigger on active tabs. Admittedly debugging's a bit annoying, since the log function doesn't store the line where the log was triggered from.

// is the tab using too much memory, discard instantly
      if (prefs['memory-enabled'] && meta.memory && meta.memory > prefs['memory-value'] * 1024 * 1024) {
        log('forced discarding', 'memory usage');
        discard(tb);
        continue;
      }

//it doesnt discard because of this.
      // in case the tab is not excluded by the initial query
      if (tb.active) {
        log('discarding aborted', 'tab is active', tb);
        exceptionCount += 1;
        icon.reset(tb);
        continue;
      }

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

No branches or pull requests

2 participants