aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_chart.js
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-08-05 17:29:18 +0200
committerGitHub <noreply@github.com>2021-08-05 17:29:18 +0200
commitb865b8f6586ffd4554cdfe45c739030afc882acd (patch)
tree37bcdf6575d8764b7367f34544658886879c0c5e /views/script/core_chart.js
parent79edea37d15f88f086f7775bbbce64a57535b043 (diff)
parent7b541bbf2a8d754d26511895801d90f02cdf99f7 (diff)
downloadkartik-client-b865b8f6586ffd4554cdfe45c739030afc882acd.tar.gz
kartik-client-b865b8f6586ffd4554cdfe45c739030afc882acd.tar.bz2
kartik-client-b865b8f6586ffd4554cdfe45c739030afc882acd.zip
Merge pull request #4 from Minteck-Projects/devel
Branching 21.08
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