I know this is a remaining JSVAR memory issue. I have a rather large app 2300 JSVARs with loads of
helper logging output.
It ran great until I started altering data sets. I started to notice intermittent errors, so started smattering code with try/catch blocks to see if I could catch errors. Minimal luck.
Today, I have a repeatable situation after an execution of a helper function that writes out ~20 consol.log() statements. A single manual invocation works great. Inside a setInterval however, started getting bizarre errors that are never caught by the try/catch blocks. After performing a dump() I can validate that this error does in fact show that previously defined vars are no longer there.
multiple near redundant lines trimmed for brevity
Uncaught Error: Cannot read property 'update' of undefined
at line 1145 col 51
console.log( " STARTUP: update: " + argsStartup.update );
Memory is getting written over. In 'C' it's the dreaded missing null line terminator. Used to malloc heapfree etc.
Using process.memory().free I can determine the amount of JSVARs available before I execute a function, but what is the proper technique to discover a possible memory overrun before it occurs at runtime? Is there a method to know whether a function call is going to require massive memory overhead before the call?
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.
Fri 2020.03.27
I know this is a remaining JSVAR memory issue. I have a rather large app 2300 JSVARs with loads of
helper logging output.
It ran great until I started altering data sets. I started to notice intermittent errors, so started smattering code with try/catch blocks to see if I could catch errors. Minimal luck.
Today, I have a repeatable situation after an execution of a helper function that writes out ~20 consol.log() statements. A single manual invocation works great. Inside a setInterval however, started getting bizarre errors that are never caught by the try/catch blocks. After performing a dump() I can validate that this error does in fact show that previously defined vars are no longer there.
Memory is getting written over. In 'C' it's the dreaded missing null line terminator. Used to malloc heapfree etc.
Using process.memory().free I can determine the amount of JSVARs available before I execute a function, but what is the proper technique to discover a possible memory overrun before it occurs at runtime? Is there a method to know whether a function call is going to require massive memory overhead before the call?
Using a MDBT42Q breakout board