-
• #3
Thanks,
I did the changes on my repo (https://github.com/Stiralbios/BangleApps) and it didn't solve the issue. The memory leak is quite high (~450) so it's probably something big that isn't unloaded like a module but I don't see how.
>eval(require("Storage").read("terminalclock.app.js")) =undefined >process.memory().usage =1529 >Bangle.setUI() =undefined >process.memory().usage =1419 >eval(require("Storage").read("terminalclock.app.js")) =undefined >process.memory().usage =1979 >Bangle.setUI() =undefined >process.memory().usage =1867 >eval(require("Storage").read("terminalclock.app.js")) =undefined >process.memory().usage =2425 >Bangle.setUI() =undefined >process.memory().usage =2313
-
• #4
I meant calling something like
if (clock.turnOffServiceTimeout) clearTimeout(clock.turnOffServiceTimeout);
to remove the timeout handler. Deleting the variable only removes the timeout id from memory until it is set again in the next line. -
• #5
Thanks, fixed it but the memory leak is still here
-
• #7
Thanks it fixed it. It was a dumb mistake XD
I keep going back to it and I have no idea why there is still a memory leak when uncommenting the
remove
method.I welcome any help or tips ;)
The code is here : https://github.com/espruino/BangleApps/blob/c0d301c1e7c59a1d8e1714cdd5b51deeb7a7ae6b/apps/terminalclock/app.js