From 44210691ee8444509ac466a362337af77f2bcd49 Mon Sep 17 00:00:00 2001 From: Minteck <46352972+Minteck@users.noreply.github.com> Date: Tue, 20 Jul 2021 01:30:23 +0200 Subject: Commit --- views/script/core_chart.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'views/script/core_chart.js') diff --git a/views/script/core_chart.js b/views/script/core_chart.js index 059c818..2f8a521 100644 --- a/views/script/core_chart.js +++ b/views/script/core_chart.js @@ -2,7 +2,7 @@ setInterval(() => { try { currentMemory = process.memoryUsage().rss; currentMemoryMib = (((currentMemory)/1024)/1024).toFixed(2); - if ((((currentMemory)/1024)/1024) > 250) { + if ((((currentMemory)/1024)/1024) > ((require('os').totalmem() / 1000000) / 4)) { throw new Error("Out of memory"); } @@ -66,5 +66,9 @@ setInterval(() => { } else { document.title="Kartik"+require('@electron/remote').getCurrentWindow().channel+require('./package.json').version + eaid; } - } catch (e) {} + } catch (e) { + if (e.message === "Out of memory") { + throw e; + } + } }, 1000) \ No newline at end of file -- cgit