Microsoft MakeCode

Program Memory

Hi everyone,

I’ve been developing a lot of code for the micro:bit IDE and am running into program memory issues.

I’ve edited the pxtworker.js file under pxt-microbit>node_modules>pxt-core>built>web>

At line 116592, i comment out the condition that checks too see if the program is too big:

I then edit it to show me a bit more information.

With that being said, I’m finding there are around 23K available out of a possible 242K of program space.
What this implies (to me) is that we are sitting at around 91% usage of program memory without adding a single block to a project. When you take a block such as music melody, I find that it takes around 7K of the memory alone. I keep running into situations where if a student adds any of my functions, you reach a program memory error very fast.

Could someone perhaps let me know if this is in fact true and if there are any obvious ways that I can reduce the program memory size while maintaining most of the functionality. I.e. Any low hanging fruit of memory that can be removed. :slight_smile: