Subject:
|
Re: Memory - Where did it go?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sat, 8 Jul 2006 13:14:43 GMT
|
Original-From:
|
steve <(sjbaker1@)IHateSpam(airmail.net)>
|
Viewed:
|
4862 times
|
| |
| |
Brian Davis wrote:
> > 2) Can someone show me one of their more complicated programs and
> > how much memory it took?
>
> Yes, but I'm not sure how informative this will be. Somebody asked this on
> theNXTstep blog, and so I looked at some sizes. The largest program I've written
> (nesting7.rbt) has 39 blocks, 6 loops, & 1 switch, and is about 2.2 Mb on the
> comp[uter, and compiles down to 23.5 kb in the NXT. If the NXT has 120 k of free
> memory, it would seem you could hold a program of about 240 blocks... but I'm
> sure some of those are bigger than others*, so... I suspect (that would make
> this an unwarrented, unsupported *guess*) a practical upper limit is around
> 150-180 blocks, if there's little else on the NXT itself. YMMV.
By "Block" you mean a simple operation like and add or a multiply or
turning on a motor or reading a sensor?
These 'blocks' ought to be turned into little interpreted byte-code
segments - it's hard to imagine how a block could possibly take up more
than a handful of bytes - so a 180 block program ought to be under 1000
bytes.
The exception would be some kind of a block that draws an image or
something - which would have to contain the data for the image itself -
which might be quite a bit bigger. But the NXT's display is pretty
low resolution - and it shouldn't take more than a few hundred bytes
to describe an image for it.
If ~40 blocks is ~23kb then I *suspect* that there is a 22kb "thing"
that goes along with every program (possibly the software that actually
interprets the bytecode or something like that) - that would mean that
programs would all come out to be about 22kb plus a fairly tiny amount
that would depend on how long your program was.
The way to tell for sure is to write a short program - compile it and
check the size - then duplicate the program so it's exactly
twice as long - and compare the size. If the file does indeed
double in size then there is something quite amazingly inefficient
going on - but I suspect you'll find that the file hardly changes
in size at all.
|
|
Message has 2 Replies: | | Re: Memory - Where did it go?
|
| (...) By "block" I mean a NXT-G code block as dropped from a pallet. Yep, you would think that these things would compile down to a single bytecode (or a few bytecode sequences), but they don't. There is an awful lot going on under the hood, and (...) (18 years ago, 8-Jul-06, to lugnet.robotics)
| | | Re: Memory - Where did it go?
|
| (...) Everything in NXT-G is a block that you drag and drop onto your program. All blocks in NXT-G are LabView Virtual Instruments (VIs). Some blocks expand into a loop construct. Others expand into a switch construct. They often represent (...) (18 years ago, 10-Jul-06, to lugnet.robotics)
|
Message is in Reply To:
| | Re: Memory - Where did it go?
|
| (...) Once you delete a lot of the "Try me" and on-brick programming stuff, this jumps up to (IMS) 120k+ or so. Still not ideal (yeah, I'd like a Mb of memory as well :-), but much better. As to what to delete, I've taken everything off but the (...) (18 years ago, 8-Jul-06, to lugnet.robotics)
|
9 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
|
|
|
|