When I upload my program to Arduino it says the memory that the program is used. But what if I use a bad management of dynamic memory, or any object is created several times in use a lot of memory and the Arduino memory overload.
How do I know the current size of memory that Arduino is use?
I am thinking about to create a function in Arduino that return me this information if I send it a request command, but also I don't know how do I inspect the Arduino memory.
Note: I am using the Board: Arduino Mega 2560.
I read the question and the answer for Measure SRAN usage
In the question @fuenfundachtzig ask:
Can I determine how much SRAM I have left in the live system?
In my question I am asking about how do I know or monitoring my program memmory. Ok the Measure SRAN usage answer give me the tips or tools to develop my idea, but the question is not the same.
I am tryin to know in an specific time what is the size of my memmory.
example...
void setup() { //doing some configuration };
void loop() { // invoke some functions and evil function };
// in other place a evil function
void evil(){
MyClass * instance = new MyClass();
//play with the instance and it class create other instances....
//and a dynamic memmory is used but not deleted.
}
I am trying to know if it happens and how do I detect with Arduino? I am not talking about how much memmory do I left in the live system.