Out of RAM or FLASH?
If RAM, reduce the amount of global variables you need
If FLASH, rewrite your code to make your generated code smaller. You might be using a lot of RTL functions that might be large (WriteLn, memory manager, etc)
You can investigate sizes of stuff with avr-embedded-nm -Sn MyProgram.elf