What can happen is that when memory gets a bit full it gets fragmented, and can no longer find a completely flat area of memory to allocate. Rather than crash it soldiers on, but because it hasn't got a flat area of memory it's a lot slower.
Ideally, to fix it you'd try and allocate the buffers you need early on and keep them allocated, rather than freeing and re-allocating which is what you might be doing?
But otherwise you can call E.defrag() which takes a while but will try and re-arrange things to get you a bigger area of free memory
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.
Hi - what's your memory usage like?
What can happen is that when memory gets a bit full it gets fragmented, and can no longer find a completely flat area of memory to allocate. Rather than crash it soldiers on, but because it hasn't got a flat area of memory it's a lot slower.
Ideally, to fix it you'd try and allocate the buffers you need early on and keep them allocated, rather than freeing and re-allocating which is what you might be doing?
But otherwise you can call
E.defrag()
which takes a while but will try and re-arrange things to get you a bigger area of free memory