That's a really interesting problem... Espruino will do automatic GC only when there's not much free memory available - if you're battery powered generally you won't want it wasting time compacting when it's not needed. Usually the heuristics used work out but it seems like in this case they're not working for you.
Just a quick one - you're not calling analogRead(...) elsewhere are you? That can interfere with the one that happens inside an interrupt and can end up causing you problems.
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.
That's a really interesting problem... Espruino will do automatic GC only when there's not much free memory available - if you're battery powered generally you won't want it wasting time compacting when it's not needed. Usually the heuristics used work out but it seems like in this case they're not working for you.
Just a quick one - you're not calling
analogRead(...)
elsewhere are you? That can interfere with the one that happens inside an interrupt and can end up causing you problems.