runtime memory limit exceeded ?
janb
Posts: 74
Hi,
I put together to working examples and got error:
runtime memory limit exceeded by 745 longs
Example 1 compiled (and worked) fine. F8 reported:
prog=1504 long,
var = 508 long
free= 6170 long
Similar benchmark for Example 2
I was expecting that if code from both is merged I'd still get ~4000 free words.
Somehow 5+5=30 [noparse]:)[/noparse]
I have attached full code. It is enough to disable constructor for the 'kal' object (marked ***HERE***) to make the code fit in to memory.
But I need this object.
Perhaps someone sees a simple way to adjust my code so it fits in to Propeller?
Thanks
Jan
I put together to working examples and got error:
runtime memory limit exceeded by 745 longs
Example 1 compiled (and worked) fine. F8 reported:
prog=1504 long,
var = 508 long
free= 6170 long
Similar benchmark for Example 2
I was expecting that if code from both is merged I'd still get ~4000 free words.
Somehow 5+5=30 [noparse]:)[/noparse]
I have attached full code. It is enough to disable constructor for the 'kal' object (marked ***HERE***) to make the code fit in to memory.
But I need this object.
Perhaps someone sees a simple way to adjust my code so it fits in to Propeller?
Thanks
Jan
Comments
You could use a different display or a smaller graphics object.
Nice app.
Are you planning to put the Prop on the same board?
Can I buy one?
Post Edited (rjo_) : 6/6/2008 2:12:56 AM GMT
could you recommend 'a different display or a smaller graphics object' I could try?
Jan
with regard to graphics objects... we have the experts available... and I would probably get it wrong.
BUT just in case you run into a wall and you want to change as little as possible, why not use a dedicated Prop for sensing and talk to your graphics prop over serial?
Steven did a version of the graphic driver that displays smaller text:
http://forums.parallax.com/showthread.php?p=707333
I don't know if this helps, but it was worth a try...
Indeed after digging around on this forum I found out people were suggesting to scarify double buffering of the screen for more code space.
So I replaced :
with :
and now I can add many more objects to my project and it still compiles.
But ... I'm nots sure I understand fully what I did. Could you confirm this change is optimal?
Could I 'recover' more propeller resources by using different values instead of $3000 & $5000 ?
I'd like to keep the screen resolution and not change the tailing 16x12
Thanks
Jan
If you want to get rid of the double buffer what you have done is fine. you can also get rid of any gr.copys that are in your code. The double buffer simply works by drawing to an offscreen buffer and then copying everything over when you tell it to. For graphics to work the bitmaps need to be aligned on 64 byte boundaries. The easiest way to do this is to simple put them at the end of the memory which is where the $5000 comes from.
Depending on how much stuff you are drawing the screen will start to flicker. If you have a look at the XOR object in the the thread Clemens mentioned it has a demo that should help to stop that.