• Wed 2019.01.30

    Now peppered with the actual address as seen by allocation:

    [L270] nArySizeRGB 180
    strg typeof: string len: 256
    Free: 1375
    addr: 536955892
    strd typeof: string len: 180
    Free: 1361
    addr: 536954404
    Uncaught Error: Cannot read property 'length' of undefined
     at line 4 col 228
    ..."+typeof strr+" len: "+strr.length);console.log("Free: "+pro...
    
    >pm()
    { "free": 1467, "usage": 3633, "total": 5100, "history": 1330,
      "gc": 0, "gctime": 7.30037689208, "stackEndAddress": 536958216, "flash_start": 134217728, "flash_binary_end": 376936,
      "flash_code_start": 134234112, "flash_length": 393216 }
    

    stackEndAddress: 536958216 - actual strg: 536955892 = 2324

    Free: 1375 - 1361 = 14     14 blocks * 16 = 224 bytes used

    strg: 536955892 - strd: 536954404 = 1488

    There should be 93 blocks of stack remaining  93 == 1488 / 16 bytes per JsVar


    String strr isn't created as it appears to run into/off the end of the stack.

    So, either; using process.memory().free to determine what memory is available isn't the best way or doesn't determine correctly the actual memory (unlikely as it's been around for some time) available or
    the way in which flat string memory is allocated needs to be re-visited perhaps?

About

Avatar for Robin @Robin started