Diecimila memory leak?

Hi all.

I'm creating a simple command line interface based on Arduino Diecimila using IDE v0017.

The program worked fine, but at this point I cannot make the program grow, because I get unexpected behaviours (hanging, mistakes reading fixed variables, garbage when printing text over the port...).

If I run the same program on Arduino Duemilanove (with more memory) there's no problem.

:-/ Any ideas?

My idea would be that you post your sketch.

If I run the same program on Arduino Duemilanove (with more memory) there's no problem.

I think you have it, your sketch takes up too much memory. This is an embedded processor it doesn't have much to begin with. You won't get a memory leak as there is no allocating memory by reference you can screw up.
However if you have a lot of static variables you could try putting them into system memory instead of taking up RAM.

You're right, Grumpy_Mike. That's the key.

I've declared a lot of strings in my code and I did'nt know that these strings are loaded into SRAM by default. I'll use PROGMEM to force flash storage and pgm_read to read them.

Also, I thought that the compiler would warn when you're using too much SRAM in your program, but I was wrong...

:slight_smile: Thanks a lot!