STM32VLDiscovery - available memory

Posted on
  • Hi,
    Just moved from 1v41 to 1v52 and it seems that 1v52 consumes slighly more memory than 1v41
    1v41>memory()
    {"free":245,"usage":9,"total":254,"histo­ry":0,"stackEndAddress":536876380}
    1v52>process.memory()

    {"free":242,"usage":12,"total":254,"hist­ory":0,"stackEndAddress":536875816,"fl}

    I wonder if there are any plans to optimize memory usage.
    We talked about it some time ago and as far as I remember it is possible to optimize internal data structure. Not sure if this optimization taken into account inn the future.

    Unfortunatelly I have a few VL boards and cannot make use of them (only simple project are possible due to memory constraints)
    Thanks,
    Bogdan

  • I'm working flat out at the moment and I'm afraid I just don't have time to work on getting the best memory usage for anything except the Espruino Board.

    If someone wanted to contribute code then that would be great though - there are a bunch of outstanding issues on GitHub that would help with memory usage.

    In your case the 48 bytes of extra memory usage is probably because memory() is now wrapped in process - so unless you check how much memory you have it won't make any difference at all.

    Realistically though, the VL doesn't have much RAM and it's always going to be a struggle to get much code in. I believe the Web IDE will now automatically minify code, which could really help though.

  • Yes, I understand.

    I have forgotten that the VL and other Discovery boards are unsuported now.

  • Just to add, there's an issue open in GitHub that could really help memory usage on the VL board (and in general). It attempts to store small integers (and booleans) in the same JsVar - halving the amount of memory used for each variable.

    I don't know when I'll get around to this, but it's on the horizon.

    However if you want to contribute something, you could look at implementing it yourself (or at other ways of reducing memory consumption).

  • Unfortunately I am not skilled enough to make such espruino enhancement.

    Lack of this memory optimization is not a problem at all.
    Sorry for asking the question about memory again... I know you are busy with more important issues.

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

STM32VLDiscovery - available memory

Posted by Avatar for BogdanG @BogdanG

Actions