I was compiling a script and I got an out of memory error in the parser.
My heap size is 4096 bytes.
I would like some guidelines on how to guestimate the amount of heap the parser will use based on the .py file
[SOLVED]mp_parse - guideline on memory
[SOLVED]mp_parse - guideline on memory
Last edited by jickster on Mon May 07, 2018 6:26 pm, edited 1 time in total.
Re: mp_parse - guideline on memory
I'm not sure that such a guideline exists. It probably depends quite a bit on the contents of the script (i.e. how the parse tree winds up looking).
You should either split the file into smaller chunks, or use frozen bytecode (then all of the compiling happens on the host). You could also transfer bytecode (.mpy) files rather than .py files. The .mpy files will still use RAM (whereas with frozen bytecode at least the bytecode come from flash not RAM).
You should either split the file into smaller chunks, or use frozen bytecode (then all of the compiling happens on the host). You could also transfer bytecode (.mpy) files rather than .py files. The .mpy files will still use RAM (whereas with frozen bytecode at least the bytecode come from flash not RAM).