It's a hard one. I recently found an issue that caused NRF.setAdvertising to create a 'memory busy' error.
If it helps: 'memory busy' means something running in an interrupt requested a new JS variable and one couldn't be provided because the main thread was using the variable store (most likely for Garbage collection).
So... If you keep calling process.memory() which triggers a GC pass then it's far more likely that you get the error - things like the memory widget will do that a lot
Aha, Pastel calls process. memory every draw, 60 seconds, I did not realise it schedules a GC as well Is there a way to get current memory usage without triggering a GC? If not I will take this out of Pastel.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It's a hard one. I recently found an issue that caused
NRF.setAdvertising
to create a 'memory busy' error.If it helps: 'memory busy' means something running in an interrupt requested a new JS variable and one couldn't be provided because the main thread was using the variable store (most likely for Garbage collection).
So... If you keep calling
process.memory()
which triggers a GC pass then it's far more likely that you get the error - things like the memory widget will do that a lot