mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:19:57 +02:00
Revert "Added ram check"
This commit is contained in:
parent
f5e70a0579
commit
f077232fd4
1 changed files with 1 additions and 19 deletions
|
@ -7,9 +7,6 @@
|
||||||
|
|
||||||
XPCOMUtils.defineLazyPreferenceGetter(lazy, 'zenTabUnloaderExcludedUrls', 'zen.tab-unloader.excluded-urls', '');
|
XPCOMUtils.defineLazyPreferenceGetter(lazy, 'zenTabUnloaderExcludedUrls', 'zen.tab-unloader.excluded-urls', '');
|
||||||
|
|
||||||
XPCOMUtils.defineLazyPreferenceGetter(lazy, 'zenTabUnloaderRamThreshold', 'zen.tab-unloader.ram-threshold', 70);
|
|
||||||
|
|
||||||
|
|
||||||
const ZEN_TAB_UNLOADER_DEFAULT_EXCLUDED_URLS = [
|
const ZEN_TAB_UNLOADER_DEFAULT_EXCLUDED_URLS = [
|
||||||
'^about:',
|
'^about:',
|
||||||
'^chrome:',
|
'^chrome:',
|
||||||
|
@ -79,15 +76,6 @@
|
||||||
this.#excludedUrls = this.lazyExcludeUrls;
|
this.#excludedUrls = this.lazyExcludeUrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getRAMUsage() { // RAM usage ceck
|
|
||||||
try {
|
|
||||||
const memoryInfo = await Components.utils.getMemoryInfo();
|
|
||||||
const totalPhysicalMemory = memoryInfo.total;
|
|
||||||
const usedMemory = memoryInfo.resident;
|
|
||||||
return (usedMemory / totalPhysicalMemory) * 100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get lazyExcludeUrls() {
|
get lazyExcludeUrls() {
|
||||||
return [
|
return [
|
||||||
...ZEN_TAB_UNLOADER_DEFAULT_EXCLUDED_URLS,
|
...ZEN_TAB_UNLOADER_DEFAULT_EXCLUDED_URLS,
|
||||||
|
@ -125,12 +113,6 @@
|
||||||
if (!lazy.zenTabUnloaderEnabled) {
|
if (!lazy.zenTabUnloaderEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check RAM usage before proceeding
|
|
||||||
const ramUsage = await this.getRAMUsage();
|
|
||||||
if (ramUsage < lazy.zenTabUnloaderRamThreshold) {
|
|
||||||
return; // Don't unload tabs if RAM usage is below threshold
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentTimestamp = Date.now();
|
const currentTimestamp = Date.now();
|
||||||
const excludedUrls = this.excludedUrls;
|
const excludedUrls = this.excludedUrls;
|
||||||
const tabs = gBrowser.tabs;
|
const tabs = gBrowser.tabs;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue