Don't forget that RAM and program memory are completely different. Do you have large constant arrays or tables?