Greeting!
I am currently working on a project and experiencing a weird behavior which i do not understand and googling this is confusing me even further. so i would really appreciate some clarification.
I am make a very large array of 1600 bytes (using Sizeof()) which i assume would be place in SRAM, but when i use the memory() library it shows only 115 bytes being used. Here is the code which i tested it on
#include <MemoryFree.h>
byte database [][4] = {
{ 0 , 6 , 20 , 20 } ,
{ 0 , 6 , 20 , 20 } ,
{ 0 , 7 , 20 , 20 } ,
{ 0 , 7 , 60 , 48 } ,
................................ Paste Bin for all the rest the forum wont let me (https://pastebin.com/WRmJckJP)
{ 0 , 7 , 20 , 20 } ,
{ 0 , 7 , 60 , 48 } ,
{ 0 , 7 , 20 , 20 } ,
{ 0 , 7 , 20 , 20 } ,
{ 0 , 7 , 20 , 20 } ,
{ 0 , 7 , 60 , 48 } ,
{ 0 , 7 , 20 , 20 } ,
{ 0 , 7 , 20 , 20 } ,
{ 0 , 7 , 20 , 20 } ,
{ 0 , 7 , 60 , 48 } ,
};
void setup() {
Serial.begin(9600);
}
void loop() {
//Serial.println(str);
Serial.println(sizeof(database));
Serial.print("freeMemory()=");
Serial.println(freeMemory());
delay(1000);
}
I am using a Arduino Leo which has 2.5KB of SRAM. Where is this 1600 Bytes going?
Thanks,
RAM_Usage__Test_.ino (9.26 KB)