ATmega2560 Flash Memory

I am using 3 mega2560 processors that will be linked together using a rough form of I/O serial, which is isolated to prevent unequal current draw by one mega I/O, what I need to know is the flash memory can hold up to 240K of programming code, but with only 8k of sram do I need to be careful how I write the code, using many subroutines or one big bunch of code in the main. What I want to prevent is stack overflow, and once I start down the path it could take a lot of time to rewrite. I kind of wonder if worried about nothing.