Falls der Chip zu wenig RAM hat, kann man mal das 1,5-fache probieren.
Ich schau mir jedenfalls deinen Code nochmal genau an