• I use the MDBT42Q (2v09) with the the ESP8266. Sometimes the memory starts to run low.
    In this case, the size of HttpCC increased:

        name: "\xFF",
        size: 1176,
        more: [
            name: "HttpCC",
            size: 359 }
      httpCRq: { "type": 1,
        "#onconnect": function (b) {var a='';b.on('data',function(b){a.length<8&­&(a+=b)}),b.on('close',function(b){e(a.s­ubstring(0,5))})},
        "res": httpCRs: { "hdrs": false },
        "opt": {
          "protocol": "http:",
          "method": "POST",
          "host": "",
          "path": "/ords/server/rest/espruino/",
          "pathname": "/ords/server/rest/espruino/",
          "search": null, "port": 8081, "query": null,
          "headers": {
            "Content-Type": "application/json",
            "Content-Length": 250 }
        "#onerror": function (a) {d='',e(),digitalPulse(LED1,1,600),log('­err1.pc'),ir('Err:1')},
        "dSnd": "",
        "sckt": 2, "cls": true,
        "dRcv": "HTTP/1.1 200 OK\r\nConnection: close\r\nDate: Thu, 03 Jun 2021 19:53:31 GMT\r\n\r1"

    if i use the following command in WEB IDE (left side), it will clean the memory:


    But i can't use it in js.
    How can I achieve the same in my javascript code?

  • Sun 2021.06.06

    'it will clean the memory:    global["\xFF"].HttpCC=[];    But i can't use it in js'
    'How can I achieve the same in my javascript code?'

    Does running the following command more frequently, both inform and improve on making memory available?


    'Run a Garbage Collection pass, and return an object containing information on memory usage'


  • @Robin yes, I use the process.memory() and in some cases it doesn't help. In those cases, I can only empty the HttpCC array manually.


Avatar for Robin @Robin started