• Thank you very much for your reply Robin!

    "Send to Espruino" was working for me fine until I believe my code reached a certain size. After that, it no longer worked no matter how many times I hit "Send to Espruino".

    I'm using v 0.75.11 of the Web IDE (sorry for neglecting to include that earlier).

    I entered process.env into the left-hand side of the IDE after running my program from storage and here's what it returned:

    >process.env
    ={
      VERSION: "2v10.90",
      GIT_COMMIT: "e60188501",
      BOARD: "EMSCRIPTEN",
      FLASH: 4194304, SPIFLASH: 4194304, HWVERSION: 1, STORAGE: 4194304, RAM: 0,
      SERIAL: "00000000-addeadde-addeadde",
      CONSOLE: "USB",
      MODULES: "Flash,Storage,hea" ... "tensorflow,locale",
      EXPTR: 94208 }
    >
    

    Hopefully that is the info you wanted to see, please let me know if you wanted something else (I obviously still have lots to learn about Espruino).

    In the last line of my program, I printed process.memory() to the console and this is what was printed:

    { "free": 2271, "usage": 229, "total": 2500, "history": 0,
      "gc": 0, "gctime": 0, "blocksize": 13 }
    >
    

    My program consists of 4 functions and "Send to Espruino" works fine if I load the first two functions but when I add in the third--and by that I mean add it to the right-hand source code pane--then "Send to Espruino" no longer does anything. After loading the second function in the source code pane, and doing "Send to Espruino" that should only have loaded the first two functions (and a few global variables) into memory, process.memory() returned:

    >process.memory()
    ={ free: 2426, usage: 74, total: 2500, history: 1,
      gc: 0, gctime: 1, blocksize: 13 }
    >
    

    If I paste nothing else but the third function into the source code pane and do "Send to Espruino", it works and the IDE tells me "No errors. Minified 6259 bytes to 2802 bytes."

    Sorry but I don't really understand how to interpret the numbers returned by process.memory() or trace() for that matter . When I load my full program into my Bangle.js storage, run it and log process.memory() to the console at the end, it returns:

    { "free": 2278, "usage": 306, "total": 2584, "history": 0,
      "gc": 0, "gctime": 4.66918945312, "blocksize": 13, "stackEndAddress": 536925152, "flash_start": 0,
      "flash_binary_end": 450188, "flash_code_start": 1610612736, "flash_length": 524288 }
    >
    

    Thank you for offering to help me figure out what's going on. My full program (of which these four functions are only a part) is ~2.5K lines/~80K. That runs fine on my Bangle.js from storage, but of course "Send to Espruino" doesn't work for that large program either. I've had to limit some features of my full program due to running out of memory so if I could get the IDE to minify my programs that would be great.

  • Mon 2021.10.11

    Reply to post #3

    post #3 'Sorry but I don't really understand how to interpret the numbers returned by process.memory() or trace() for that matter'

    http://www.espruino.com/Reference#process

    Glance over as previously provided

    https://www.espruino.com/Internals

    Simple answer, Total - Usage = Free

    For me, when Free gets to below ~150 it's time to take a break and figure out what to take out.

    History is what occurs as one uploads from the L-Hand console side. Espruino will retain until it determines possible memory issues then do some housekeeping to clear. See my link in post #6 on one way to clear if desired. Although I wondered what might go awry, that value may be ignored for most development.

  • Reply post #3

    'and by that I mean add it to the right-hand source code pane--then "Send to Espruino" no longer does anything.'

    As explained in post #3 I'm cut-n-paste in both the R-Hand editor side and upload, along with just the first two functions followed by the rest in the L-Hand console side.

    What browser and PC OS are you running on?

    I'm not having issues with ttchoice.app.js using Chrome on Windows10

About

Avatar for TTBangler @TTBangler started