The issue you're hitting here is actually one of fragmentation. The standard Flat String allocator tries to allocate a flat string quickly - and if the free list (not the actual data!) gets fragmented it can fail.
I've now changed E.toString to try harder (which fixes your problem) but have also made is pass through Uint8Arrays if they're backed by a flat string - so in that case it'll make things much faster for you as well.
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.
The issue you're hitting here is actually one of fragmentation. The standard Flat String allocator tries to allocate a flat string quickly - and if the free list (not the actual data!) gets fragmented it can fail.
I've now changed
E.toString
to try harder (which fixes your problem) but have also made is pass through Uint8Arrays if they're backed by a flat string - so in that case it'll make things much faster for you as well.