Go Down

Topic: How much ram is being used? (Read 31 times) previous topic - next topic


I am trying to put together a few 18b20 temp sensors, an 8x2 LCD with the lcd4bit library and a DS1305 RTC.  my sketch size is about 10k of 16k..  I get to a certain point and something is corrupting the LCD stream..  I can't see how I am using up 1k of RAM..  is some of that lost to overhead?

How do I find how much RAM is in use?  What can I do to find out what is overlapping?


I suspect that much AVR debuggers, like the Dragon, can give you the amount of ram your program is using, but this needs to be confirmed.

There are many reasons why data can get corrupted, like a buggy line writing too much data at some place... or many others ^_^
... could use some sleep


The wierd part is if I comment out different lines of code, the problem goes away.

I didn't start having this problem until I got somewhere over 9k of sketch


So probably your analysis is right... I'd considerer buying a Dragon or similar debugger to see what's happening, or just go study the libs I use to see how much ram they potentially consume...
... could use some sleep


Jun 16, 2008, 06:09 am Last Edit: Jun 16, 2008, 06:09 am by bens Reason: 1
You can write your own function to figure out how much free RAM you have on your mega168 at any point in your execution.  Please take a look at this thread for more information:


- Ben

Go Up