You are reading a single comment by @Denis and its replies. Click here to read the full conversation.
  • Hello.
    I use wifi.ping wifi.ping with setInterval under v1.96 and NodeMCU, it have memory leak in case if I use callback function and function wifi.ping always return undefined. See code and result below.
    How it's may be solve? I need to have result of ping: successful or fail, without check of callback argument, in this case memory leak will not present.

    var wifi = require("Wifi");
    wifi.stopAP();
    function onInit() {
      wifi.connect("ssid", {password: "password"});
      setInterval(function(){
        console.log(wifi.ping("192.168.2.1", function(b){
          //console.log(b);
        }));
        console.log(process.memory().free);
      }, 5000);
    }
    

    result:

    undefined
    1371
    undefined
    1303
    undefined
    1218
    undefined
    1134
    undefined
    1061
    undefined
    976
    undefined
    891
    undefined
    806
    undefined
    721
    undefined
    636
    undefined
    551
    undefined
    466
    undefined
    381
    undefined
    296
    undefined
    211
    undefined
    126
    undefined
    41
    Execution Interrupted
    New interpreter error:
    Execution Interrupted
    
About

Avatar for Denis @Denis started