You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Well, the garbage collector doesn't really know very much about what's going on. I'm not quite sure I understand your problem - you actually have a leak in your code (rather than Espruino itself?).

    You can run the debugger when memory usage gets too high: if (process.memory().free<500) debugger;

    And you can also see how many variables each object is using with: E.getSizeOf(myobject)

    For instance you could dump all your global variables and their sizes with: for (var i in global) print(i+" : "+E.getSizeOf(global[i])) (I actually just fixed a bug that can make this crash in some cases though)

    Then you could keep track of those and see if any of them rise up (of course it could be a variable in a closure that's causing you problems).

    If you've got specific problems debugging it I'd post up in another thread though - I think the answers would be helpful to a lot of people.

About

Avatar for Gordon @Gordon started