Using lots of dynamic memory bad?

don't remember what part of the IDE this is called, but this showed up at the bottom part.

Sketch uses 19,960 bytes (7%) of program storage space. Maximum is 253,952 bytes.

Global variables use 6,631 bytes (80%) of dynamic memory, leaving 1,561 bytes for local variables. Maximum is 8,192 bytes.

Low memory available, stability problems may occur.

basically i made an html document for my ethernet sketch, which ended up being lengthy. this just seems like a warning, but i don't know how bad of a thing it is to have "1,561 bytes" for local variables.. should i be using an SD card for lengthier codes like this?

That count of global variables only considers the variables which are allocated RAM space by your program. It doesn't include any additional variables that your program might ( or might not ) try to create while it is running. This includes any local variables created in your functions, and space for class objects, and parameters for function calls.

Using 80% of the available RAM for global variables might, or might not, be a problem, depending on what else your program does.

Use the F macro to put constant data into flash.

client.print(" a bunch of text that will never change cause it is constant");

With the F macro:

client.print(F(" a bunch of text that will never change cause it is constant"));

lol michinnyon nice name :smiley:

what's an F macro?

The F macro is a piece of code that places constant char arrays in progmem/flash

What groundfungus and the others are saying is that string constants like:

Serial.println("This is a line of text.");

actually consumes both flash and SRAM memory because such constants are duplicated when the program runs. However, using the F() macro prevents the string constant from being duplicated in SRAM. SRAM is a very scarce commodity in the Arduino family and the F() macro may mean the difference between being able to compile and run a program or not. Therefore, simply changing the statement to:

Serial.println( F("This is a line of text.") );

prevents the duplication.