Bangle.js emulator running out of memory

Posted on
  • The emulator performs some strange variable reassignments to my code when I try to minify it.
    When I change these variable definitions from let keys; to var keys; and re-run the code, I get low memory errors. This happens for both Bangle.js 1 and 2.
    How can I overcome these limitations? Is there a way that I can simulate more memory on the emulator?

  • Ahh, yes, the issue is with the way Espruino doesn't handle let with scoping - and unhelpfully the minifier tends to overlap variable names whenever it can. It came up somewhere else recently, and using var is definitely the best bet.

    As far as I know the Emulator has as much RAM as a real Bangle, so if you're hitting memory errors then it's probably a sign that your code just won't work on a real Bangle.

    It's rare that normal code has issues like this especially on Bangle.js 2. Have you seen http://www.espruino.com/Code+Style#other-suggestions

    Are you doing something like trying to transpile code?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle.js emulator running out of memory

Posted by Avatar for Asynchronous @Asynchronous

Actions