• See edit at foot of this post... not sure if this is a bug but same in 1.87 when I replicate the process.

    There is a regression in that build, a memory leak, maybe Wifi or socket related? I don't know at what point it may have been introduced, since I'm on 1.87, but there's a steady reduction in process.memory().free when I review. Reverting to 1.87 and stable again.

    The sample code I tried.

    var wifi = require("Wifi");
    var mqtt = require("https://github.com/olliephillip­s/tinyMQTT/blob/master/tinyMQTT.min.js")­.create("iot.eclipse.org");
    var topic = "/op/test";
    var message = 0;
    
    mqtt.on("connected", function(){
      setInterval('mqtt.publish(topic, "test" + message);', 2000);
    });
    
    mqtt.on("published", function(){
      console.log("message sent");
    });
    
    mqtt.on("disconnected", function(){
      console.log("disconnected");
      mqtt.connect();
    });
    
    wifi.connect("SSID", {"password":"password"}, function(err){
      if(!err){
        console.log("Connected"); 
        mqtt.connect();
      } else {
        console.log(err); 
      }
    });
    

    Edit: Actually, you only get this on saving code, and in 1.87 too. Upload the code, let it start running, save() in the console on left, and then free starts to decline. Maybe this is not an issue since I only did this for the purpose of the test above.

    Normally, code will be wrapped by E.on("init", ...) at upload before save().

    Am interested to know what could be happening here though

About

Avatar for Ollie @Ollie started