comp.lang.ada
 help / color / mirror / Atom feed
* Ram Usage
@ 2014-01-19 18:18 Vinicius Franchini
  2014-01-20  1:36 ` Oliver Kleinke
  2014-01-20  9:40 ` Niklas Holsti
  0 siblings, 2 replies; 3+ messages in thread
From: Vinicius Franchini @ 2014-01-19 18:18 UTC (permalink / raw)


Hi folks,

 I'd like to know if there are anyway to know how much of ram is been used by my code. 

I tried the avr-size, but it gives you just the static ram. The problem is how to evaluate the full memory consumption, including the non-static part. 

Thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ram Usage
  2014-01-19 18:18 Ram Usage Vinicius Franchini
@ 2014-01-20  1:36 ` Oliver Kleinke
  2014-01-20  9:40 ` Niklas Holsti
  1 sibling, 0 replies; 3+ messages in thread
From: Oliver Kleinke @ 2014-01-20  1:36 UTC (permalink / raw)


> Hi folks,
> 
>  I'd like to know if there are anyway to know how much of ram is been
> used by my code. 
> 
> I tried the avr-size, but it gives you just the static ram. The
> problem is how to evaluate the full memory consumption, including the
> non-static part. 
> 
> Thanks.

You can debug with JTAG or a simulator, use an "high-water mark" or dump
the SP (or SP minus &__heap_start, calculation may vary depending on
your linker flags/ram layout[1]). I think these 3 are the most common
methods.

--
[1] - http://www.nongnu.org/avr-libc/user-manual/malloc.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ram Usage
  2014-01-19 18:18 Ram Usage Vinicius Franchini
  2014-01-20  1:36 ` Oliver Kleinke
@ 2014-01-20  9:40 ` Niklas Holsti
  1 sibling, 0 replies; 3+ messages in thread
From: Niklas Holsti @ 2014-01-20  9:40 UTC (permalink / raw)


On 14-01-19 20:18 , Vinicius Franchini wrote:
> Hi folks,
> 
> I'd like to know if there are anyway to know how much of ram is been
> used by my code.
> 
> I tried the avr-size, but it gives you just the static ram. The
> problem is how to evaluate the full memory consumption, including the
> non-static part.

For stack consumption you can try a static analyzer such as my Bound-T
(www.bound-t.com). This analyzer does not (yet) address the GNAT
secondary stack, but, if I remember correctly, there is no secondary
stack in GNAT for AVR. I have no suggestions for heap memory usage.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-20  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-19 18:18 Ram Usage Vinicius Franchini
2014-01-20  1:36 ` Oliver Kleinke
2014-01-20  9:40 ` Niklas Holsti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox