Closed GoogleCodeExporter closed 9 years ago
With line 258 uncommented, I see RAM consumption of over 4k byte. Leonardo
only has 2.5k of RAM. (With line 258 commented, there are no other uses of
dt2[] in the sketch, so it is optimized into non-existence, freeing a big chunk
of ram.)
avr-size
/var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/build1647521302299277532.tmp/sk
etch_sep12a.cpp.elf
text data bss dec hex filename
5672 2046 216 7934 1efe /var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/build1647521302299277532.tmp/sketch_sep12a.cpp.elf
BillW-MacOSX-2<10392> avr-size
/var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/build1647521302299277532.tmp/sk
etch_sep12a.cpp.elf
text data bss dec hex filename
5736 3912 216 9864 2688 /var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/build1647521302299277532.tmp/sketch_sep12a.cpp.elf
If dt and dt2 are constants, investigate putting them in flash memory (see
"pgmspace")
(not an Arduino-level issue, except as another example of needed some RAM
sizing info.)
Original comment by wes...@gmail.com
on 12 Sep 2012 at 4:37
I'm not sure how to see the RAM consumption still, but I'll look into it and
check about flash memory as well.
The only indicator I saw of memory use at the end of a verify was:
'Binary sketch size: 11,996 bytes (of a 28,672 byte maximum)'
but maybe this is only a flash memory check?
It could be helpful to add a RAM use check as well for the configured board and
print that message below the binary sketch size.
Thanks
Original comment by alex.n.j...@gmail.com
on 12 Sep 2012 at 5:32
The RAM size check is http://code.google.com/p/arduino/issues/detail?id=40&q=RAM
(also issue 444)
It's a bit thorny because of the complications that happen when ram is "nearly"
full. No existing compile-time RAM checks include RAM space used by the stack
or dynamic allocation, so even if avr-size reports large amounts free, you
could still run out. I think the team is worried that providing a false sense
of security is worse than providing no info at all.
Original comment by wes...@gmail.com
on 13 Sep 2012 at 12:03
Original issue reported on code.google.com by
alex.n.j...@gmail.com
on 12 Sep 2012 at 2:56Attachments: