I had the following "struct". When I compile it this way, it leaves 32040 bytes for local variables.
#define MAX_CALLERS 300 // Much more than this and the ESP throws up! You'll see it on the serial monitor.
typedef struct // This is where I keep track of which IP addresses have accessed this server.
{
unsigned long firstSeen; // Epoch
unsigned long lastSeen; // Epoch
IPAddress iaddr; // Little Endian
long count; // Times seen
// byte ct412s; // Count of times this guy has 412'd after being told not to.
} IPCallers;
IPCallers MyCallers[MAX_CALLERS]; // Table for keeping unique IP addresses and access counts.
If I uncomment the "byte ct412s;" the remaining memory is 30840. That's a difference of 1200 bytes. I use "byte" and, since I am defining only 300 of them, it should only use 300 bytes.
Why are the extra 900 bytes going? The first time I did this, I had the "byte" line higher and I thought it might be an alignment thing so I moved it to the end. Is it still an alignment thing?