I'm skeptical about your memory use calculations. Some time ago one of the old hands here posted a code fragment that can be used to measure actual memory use. I suggest you add that and see how much memory you actually have spare:
// this function will return the number of bytes currently free in RAM
extern int __bss_end;
extern int *__brkval;
int freemem()
{
int free_memory;
if((int)__brkval == 0)
free_memory = ((int)&free_memory) - ((int)&__bss_end);
else
free_memory = ((int)&free_memory) - ((int)__brkval);
return free_memory;
}