Memory leak, missing a few bytes

Posted on
  • Hello Gordon,

    Received the Espruino. What i nice device! But i think i've found a mem leak.
    Using 1v55.

    The simple code:

    // Callback function for din change

    var cl=function(e) {  
        if (e.state===true) {
            print("Test...\n");
        }
    };
    var wid=setWatch(cl,B12,{repeat: false, debounce: 20});
    

    After uploading process.memory(); shows 1766 free.

    Each buttonpress decreases the free mem by aprox. 2 bytes.

    Regards

    Sacha

  • Those are not bytes - those are memory blocks, 20 bytes each.

    Does trace() show the cause of the missing memory? That's what Gordon suggested I use to investigate my own memory leak issue.

  • @Sacha - thanks! I'll get on to this - it looks like an issue with debounce. It should also pay attention to repeat:false :)

  • Hi Gordon,

    Thanks. Had the same memleak befor using repear: true.
    Let me know when it's fixed. I will doublecheck it.

    Regards

    Sacha

  • If you remove debounce then the memory leak will disappear I think?

  • Hi Gordon,

    I can confirme this. Without debounce there is no mem leak.
    @DrAzzy thanks for the hint that this are junks of 20 bytes.

    Sacha

  • Should be fixed when 1v56 comes out - or on the 'latest' builds

  • Thanks Gordon.

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

Memory leak, missing a few bytes

Posted by Avatar for Sacha @Sacha

Actions