Over several months I have been building a sophisticated home automation system. I am using a Freetronics Ethermega card with 256K Flash, 8K RAM, 4K EEPROM. I am using its ethernet connectivity for the user interface and SD card file for non RAM data storage. The application is currently 5,000 lines and 97K.
On a few ocassions I have run out or RAM and the application has hung. Each time I have researched my options and applied fixes to reduce RAM usage. I use F() strings, have another 2.5K of strings in EEPROM and I am using the SD Card to store 3.6K of infrequently used strings that the application loads as required. The application (as of today) typically runs between 1K and 2K of free RAM depending on many factors.
I have written procedures to analyse and record the application's RAM utilisation during runtime and within selected (many) procedures. On occasions RAM has been seen to get very low, but apparently not run out because the application has continued to run. On some of these occasions my system's log files indicate large numbers of (generally php) hacking attempts directed to my external IP address which pass through to my application's ethernet server functionality via http port 80 . My system has recorded and successfully dealt with as many as 50 php hacking attempts within the space of one minute.
Does anyone know the effect of buffered and unprocessed HTML (hack) requests on RAM within an Arduino ethernet unit? If many many HTML hack requests are sent to an IP address associated with an Arduino ethernet unit within a second will they quickly overflow RAM if the Arduino cannot dispatch (EthernetClient.flush() and EthernetClient.stop()) them faster than they are arriving? Or is it possible that my ADSL modem, ISP and the internet generally will buffer (or discard) excess requests until the Arduino ethernet unit is ready to process them.