• Thanks Gordon. Seeing a partial fix with 1v90; but now there's a clear memory leak.

    I updated with 1v90.
    I also soldered a 10uF ceramic capacitor between Vcc and GND on the ESP8266 Wifi Module.

    Adding process.memory() to the code the leak is clearly visible. It makes about 15 require("http").get() calls before it's out of memory. I then see ERROR: Out of memory! followed by ERROR: Error processing Serial data handler - removing it.

    Here's the code I used:

    
    var tries=0;
    function onInit() {
      digitalWrite(B9,1); // enable on Pico Shim V2
      Serial2.setup(115200, { rx: A3, tx : A2 });
      var wifi = require("ESP8266WiFi_0v25").connect(Seri­al2, function(err) {
        if (err) throw err;
        wifi.reset(function(err) {
          if (err) throw err;
          console.log("Connecting to WiFi");
          wifi.connect("SSID","password", function(err) {
            if (err) throw err;
            console.log("Connected");
            setInterval(function () {
              require("http").get("http://www.espruino­.com", function(res) {
              });
              console.log("Attempt #" + ++tries);
              console.log(process.memory());
            }, 15000);
          });
        });
      });
      
    }
    onInit();
    

    It's leaking 100-200 with each call. Oddly, it's not constant.

    Any idea where the leak is?

About

Avatar for .Neil @.Neil started