You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi. You can basically ignore 'history' now - process.usage is all you need.

    If you look at trace, each blinker is allocating:

    A Blinker instance 12 blocks
    An interval 8 blocks
    A newly instantiated callback function (including the scope that Blinker.prototype.start was executed in) ~16 blocks

    So each new Blinker is a total of 36 blocks = 720 bytes.

    When you use require, you could try calling http://www.espruino.com/Reference#l_Modu­les_removeAllCached after instantiating all Blinkers? That'll probably free the cached module.

    IMO Espruino could do significantly better. If we added a Function.prototype.bind function you could skip defining the function inside start() and that'd save you a lot of memory.

About

Avatar for Gordon @Gordon started