From 03ba3060182ca6a7a41bb02ff30399d29c9b6568 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Fri, 14 Oct 2022 11:12:34 +0300 Subject: [PATCH] Reduce loaded tabs limit if the system has 8 GB or less memory --- chrome/content/zotero/tabs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index bbf760572d..250f461dc9 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -30,7 +30,9 @@ var React = require('react'); var ReactDOM = require('react-dom'); import TabBar from 'components/tabBar'; -const MAX_LOADED_TABS = 5; +// Reduce loaded tabs limit if the system has 8 GB or less memory. +// TODO: Revise this after upgrading to Zotero 7 +const MAX_LOADED_TABS = Services.sysinfo.getProperty("memsize") / 1024 / 1024 / 1024 <= 8 ? 2 : 5; const UNLOAD_UNUSED_AFTER = 86400; // 24h var Zotero_Tabs = new function () {