finishing with the low memory error and cluttering memory
I guess it's possible there is a 'lock leak' - it was designed as more of a debug function so may not have been tested that extensively for how it copes with low memory. Having said that I just looked at the code and I can't really see how that would happen.
It's worth noting that E.getSizeOf(instance) - E.getSizeOf(class) will use virtually no memory at all (2 vars?). Adding a depth argument doesn't make it give you different numbers or call diffferent functions - it just uses up loads of memory (if you're not using all the info created when calling it).
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.
I guess it's possible there is a 'lock leak' - it was designed as more of a debug function so may not have been tested that extensively for how it copes with low memory. Having said that I just looked at the code and I can't really see how that would happen.
It's worth noting that
E.getSizeOf(instance) - E.getSizeOf(class)
will use virtually no memory at all (2 vars?). Adding adepth
argument doesn't make it give you different numbers or call diffferent functions - it just uses up loads of memory (if you're not using all the info created when calling it).