You are reading a single comment by @halemmerich and its replies.
Click here to read the full conversation.
-
Edit: Removed duplication with @Ganblejs earlier post.
- Check for any watches, timeouts, intervals that might survive the removal of the app and clear them in
remove
. - If code running in timeouts or intervals needs access to variables you might need to move them out of the block into the global scope. Those must then explicitly be deleted during
remove
.
I use the following uploaded to RAM to do a smoke test for memory leaks:
let app = "launch.app.js"; print("Initally load app", process.memory().free); Bangle.load(app) setInterval(()=>{ print("Reload app with free", process.memory().free); Bangle.load(app); },1000);
This code loads the app over and over. It usually settles in after 1 or 2 iterations and does not change a lot after that with most apps. This will not cover all cases, but it should give you a start. As usual, do changes piece by piece and test between steps.
- Check for any watches, timeouts, intervals that might survive the removal of the app and clear them in
yes.
Bummer, I hoped it was easier. Could you guys help me to tidy up the watchface somehow?
It might look as I'm a programmer, but most I do is copy&paste (like a senior programmer - but without the background knowledge :) )