This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RAM-Memory counter for C programmes
- From: lynx dot abraxas at freenet dot de
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 26 Sep 2007 17:37:55 +0200
- Subject: RAM-Memory counter for C programmes
Hello!
Having programmed an AVR-microcontroller which is set up in a Harvard
architecture my programme runs out of RAM-memory (the stack seems to colide
with data). Now I wonder if there is something like a RAM-memory counter that
analyses the code and calulates the RAM useage of the programme considering
also the stack size. I found something for java
(http://www.javaspecialists.eu/archive/Issue142.html) but not for C. I think
it would depend on the code if such a calulation or estimation would be
possible at all but for programmes not dynamically allocating memory and
having a fixed maximum number of called functions this should be possible,
shouldn't it?
Other thing I wonder is if a Harvard architecture can crash at all. Getting
stuck in an infinit loop if data and stack colide is possible of corse but
changed behavior of the code should not happen, or am I wrong here?
Thanks
Lynx