You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 5, 2022. It is now read-only.
The problem is with the interval timers in the node_helper.js. With every page request new timers are created but never stopped/deleted. This resultes in increasing faster updates of the stats and also increasing performance and memory consumption until raspberry crashes.
I fixed this in my branch (https://github.com/Sickboy78/MMM-SystemStats) by moving the interval timers to the client side, so they are resetted with each page request.
I created a Pull Request (#27), which also contains support for remote hosts.
The text was updated successfully, but these errors were encountered:
I happened to see this issue and have a question about your findings. It appears that the setInterval only gets called 1 time when initialized. But, are you saying if you access the MM over and over again in a browser that this in turn causes the setInterval to get called each time which results in many timers getting created? If this is the case do these additional timers persist even after the browser window is closed?
Hi Ben! Yes thats exactly what I'm saying. With every page request, a new timer gets created.
Add these 3 lines for debugging into the socketNotifictaionRecieved method:
var diff = Math.round((Date.now() - window.lastUpdate)/100)/10;
console.log("Notification Recieved. Time since last update: " + diff + "s (Config.updateInterval: " + this.config.updateInterval + ")");
window.lastUpdate = Date.now();
Then do some page reloads and have a look at your browsers console.
Or open a second browser.
I have attached a screenshot where I reloaded the page with Firefox a few times. Then I opened it in a newly opened Chrome and you can see, all the timers created by Firefox are also send to Chrome.
Even after closing both browser and restart them, the timers persist.
The problem is, that the timers are never stopped, because the node_helper.js does not keep track of the open browsers etc. Simplest solution is, as I proposed, move the timers on the client side. (from node_helper.js to MMM-SystemStats.js). So if you reload the page or close the browser, they get stopped automatically.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The problem is with the interval timers in the node_helper.js. With every page request new timers are created but never stopped/deleted. This resultes in increasing faster updates of the stats and also increasing performance and memory consumption until raspberry crashes.
I fixed this in my branch (https://github.com/Sickboy78/MMM-SystemStats) by moving the interval timers to the client side, so they are resetted with each page request.
I created a Pull Request (#27), which also contains support for remote hosts.
The text was updated successfully, but these errors were encountered: