True.  Although recursion on motes is probably ill-advised unless you
can accurately predict the termination condition, in which case that
simplifies matters somewhat but yes, in general, estimating stack
usage is tricky.  A common technique is to pre-fill the stack space
with some special value or pattern, run your program, and inspect the
stack to see where in memory the special pattern has been overwritten.
 Then, you can put a margin of safety in, but its still not foolproof.

- Prabal

On 3/30/06, Jonathan Hui <[EMAIL PROTECTED]> wrote:
> Actually, determining the memory required for an application is harder
> than that. What's given to you at compile time is the statically
> allocated portion of RAM. It does not say anything about how much
> stack space an application may require. In general, the latter is much
> harder to determine, especially if your code contains recursion.
>
> --
> Jonathan W. Hui
> [EMAIL PROTECTED]
> http://www.cs.berkeley.edu/~jwhui/
>
>
> On 3/30/06, Prabal Dutta <[EMAIL PROTECTED]> wrote:
> > Unless you actually use dynamically allocated memory (which would
> > probably come from a statically allocated heap anyway), you can
> > determine the ROM (aka code or program) size and RAM (aka memory) by
> > building for your target platform (e.g micaz, telosb, etc).  For
> > example:
> >
> > $ make micaz
> > mkdir -p build/micaz
> >     compiling Blink to a micaz binary
> > ...
> >     compiled Blink to build/micaz/main.exe
> >             1532 bytes in ROM
> >               49 bytes in RAM
> > avr-objcopy --output-target=srec build/micaz/main.exe build/micaz/main.srec
> > avr-objcopy --output-target=ihex build/micaz/main.exe build/micaz/main.ihex
> >     writing TOS image
> >
> > $ make telosb
> > mkdir -p build/telosb
> >     compiling Blink to a telosb binary
> > ...
> >     compiled Blink to build/telosb/main.exe
> >             2582 bytes in ROM
> >               40 bytes in RAM
> > msp430-objcopy --output-target=ihex build/telosb/main.exe 
> > build/telosb/main.ihex
> >     writing TOS image
> >
> >
> > - Prabal
> >
> >
> >
> > On 3/30/06, Brett Parsons <[EMAIL PROTECTED]> wrote:
> > > Hi All,
> > >
> > > I'm running some performance metrics on TinyOS applications using the
> > > TOSSIM framework.  One of my metrics is code size (static and dynamic).
> > > Dynamic code size is easy enough to determine as I just look at how
> > > large the compiled executable is.  I'm not sure how to measure dynamic
> > > code size, however.
> > >
> > > By dynamic code size I mean, when the application is running, what is
> > > the total amount of memory required for correct operation of the
> > > application?  Is there any way to determine this with TOSSIM?
> > >
> > > Thanks,
> > >
> > > Brett
> > > _______________________________________________
> > > Tinyos-help mailing list
> > > [email protected]
> > > https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> > >
> >
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> > https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to