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.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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.