Here's also an example sketch:
#include <MemoryFree.h>
// Reported free memory with str commented out:
// 1848 bytes
//
// Reported free memory with str defined:
// 1834
//
// Difference: 14 bytes (13 ascii chars + null terminator
// 14-bytes string
//char str[] = "Hallo, world!";
void setup() {
Serial.begin(115200);
}
void loop() {
// also uncomment this line
// when uncommenting the str definition line
// otherwise the unused string will be compiled out
//Serial.println(str);
Serial.print("freeMemory()=");
Serial.println(freeMemory());
delay(1000);
}