Оptimize memory

Hi all! There was a problem.
I wrote a program menu that takes up a lot of dynamic memory.
In my program, dynamic memory overflows faster than the main one.
How to optimize the filling of dynamic memory?

Error:
“Sketch uses 64486 bytes (25%) of program storage space. Maximum is 253952 bytes.
Global variables use 8953 bytes (109%) of dynamic memory, leaving -761 bytes for local variables. Maximum is 8192 bytes.”

Thanks in advance!

This is difficult to do with an indirect programming method like XOD. The easiest solution is to get an Arduino with more memory.

If you really need to reduce your memory usage, the first step is determining what is using the memory. Obviously anywhere you store a value is going to use dynamic memory, but with XOD it is not always obvious where that is happening. You might be stuck deleting one of the nodes from your program, then re-compiling to determine how much memory it used, then repeating with other nodes. Once you know which node(s) are using the most memory, you can try to reduce how many of those you need. Maybe you can optimize to just use fewer of them (or use fewer inputs for those that can expand), or maybe there are other nodes that use less memory that can be used instead. If I remember correctly, select node is one that uses a surprising amount of memory.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.