|
> Well, I've gone and run out of memory with my RCX. It manifested itself in
> a task that refused to run, presumably because the OS couldn't allocate
> enough memory for its stack. Took a while to track down and was annoying,
> but it was my own fault for not checking error codes.
You can test memory left using the routine from Eddie:
http://news.lugnet.com/robotics/rcx/legos/?n=1129
> Anyway, my question is, how can I reduce memory usage? I think cutting
> down LegOS itself is pretty much a lost cause. Of the list in the HOWTO,
> sound is about the only optional item. I suppose I could try turning that
> off and seeing how much that saves. Is the size of .srec and .lx files a
> good indicator of how much space the respective programs will take up in
> the RCX? Is it possible to have gcc optimize for space? Is gcc smart
> enough to throw away functions I don't use once the compilation process is
> complete? Lastly, how can I figure out approximately how much stack space
> a task will need? I have several tasks running, and most of them don't use
> much in the way of local variables or deep calling chains, so the default
> stack space is probably quite a waste for those.
LegOS is already optimized for space. You can save some bytes changing
config.h to exclude some features, but I think that the best place for
optimizing is your own program...
Bye,
Paolo.
---
"She may not look like much, but she's got it where it counts, kid."
|
|
Message has 1 Reply: | | Re: Memory Usage
|
| (...) Well, I was thinking along the lines of having gcc optimize my program for space instead of speed. Of course, I'd be better off if *I* optimized for space instead of speed, but it can't hurt to have the compiler working for me, if it's (...) (24 years ago, 15-Oct-00, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Memory Usage
|
| Well, I've gone and run out of memory with my RCX. It manifested itself in a task that refused to run, presumably because the OS couldn't allocate enough memory for its stack. Took a while to track down and was annoying, but it was my own fault for (...) (24 years ago, 14-Oct-00, to lugnet.robotics.rcx.legos)
|
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|