aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_chart.js
diff options
context:
space:
mode:
Diffstat (limited to 'views/script/core_chart.js')
-rw-r--r--views/script/core_chart.js8
1 files changed, 6 insertions, 2 deletions
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