Mega 2560 Maxium Sketch Size?

I have a Mega R3, using IDE 1.0.3 with windows. If I upload a sketch that is 40,118 bytes of 258,048, it loads and runs. If I upload a sketch (with no errors) that is 41,544 bytes or more, I don't get any errors but the program does not run on the board. Any help/solutions would be greatly appreciated! I really only need a little more memory for my application. Thanks!

Programs that upload OK but don't run properly, upon passing some particular program size, seem to usually be due to using up all the RAM (data) memory on your chip, rather than the program memory. Strings, for instance, consume data memory even though you might think that they don't. See other threads on mentioning "progmem"

A useful shortcut to avoiding explicit PROGMEM handling is to use the F() macro wherever possible - see here

Typo maybe?? I found the F() macro explained at http://arduino.cc/en/Main/ReleaseNotes

Typo maybe??

Where?

In the link

It points to the "print" method, where the third paragraph says

You can pass flash-memory based strings to Serial.print() by wrapping them with F(). For example :
Serial.print(F(“Hello World”))

You're right, I missed it.

The F() Fixed It!!! I had a whole bunch of client.print("....") statements. I changed them to client.print(F(".....")and the program uploaded and works. Thank you very much for all your help!!!