OK, so where did my runtime memory go...
CannibalRobotics
Posts: 535
If I 'view info' on a set of compiled objects I'm told I have 6,169 longs free.
When I add this piece of code to the top object:
if LatchData & %0000_0000_1000_0000_0000_0000_0000_0000· > 0
·· repeat i from 0 to 7
···· ADMin[noparse][[/noparse]i] :=255
···· ADMax[noparse][[/noparse]i] :=0
I get a the error "Object exceeds runtime memory by 9 longs." and the compiler stops.
Go figure...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
When I add this piece of code to the top object:
if LatchData & %0000_0000_1000_0000_0000_0000_0000_0000· > 0
·· repeat i from 0 to 7
···· ADMin[noparse][[/noparse]i] :=255
···· ADMax[noparse][[/noparse]i] :=0
I get a the error "Object exceeds runtime memory by 9 longs." and the compiler stops.
Go figure...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
Comments
I guess the question is why would such a small addition have such impact?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
use the archive-function of the proptool to zip ALL files that were needed and attach this to a posting using the attachment manager
which will appear after clicking on Post Reply instead of using the quick-reply function
best regards
Stefan
I am using the Graphics object but none of the sprite management or fancy text so I've pulled out a few of those unused calls; textarc, pix and pixarc it will compile fine.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
The problem got worse. Now I'm like 187 longs over the limit.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
You can switch to a single video buffer, if you can live with some flickering. Search in the forum for this, we had it many times...
(use http://search.parallax.com, not the forum search).
Andy
Mike, I did a search on _free= in Graphics, TV and the top module, no hits.
Any other names?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
the _stack defines two buffers with $3000 = 12kByte, + 100 bytes stack
I think you have just copied that.
Edit: reducing color memory dont brings a lot of memory back (1 long per color)
Edit2: look also for stevenmess' XOR graphic object, this can help to work with a single video buffer: SDM_graphics_XOR in the obex.
Post Edited (Ariba) : 10/16/2008 7:37:21 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
OK first of all a short message to demonstrate how quick posts result in a slow solution proecess
quick version: " I added your lines of code and it compiles with no error and still 6293 longs free
from this quick post you know almost nothing.
quick as that questions stay open:
wich code added ?
code where added?
which proptool-version?
now if we would go on in this style we would have to start a ping-pong game
of asking short questions asking back get short answers short questions again and again etc. etc.
that's not effective!
so here a version that provides DETAILED information:
I downloaded your project and added the codelines from your first posting
in file HumanInterface_v1.4.SPIN inside the PUB main
the compiler reported two errors because of two array-variables missing
I added these two arrays to the VAR-section of HumanInterface_v1.4.SPIN
after that everything compiles with Key F8 with no errors and 6293 longs still free
my environment: Proptool V1.2 under windows vista home premium
So from this version of your code we have only the information it compiles when
object
is commented out.
I guess to go ahead to FIND a solution next step is that you archive EXACTLY that code
that creates the error. No more quick and dirty cut & paste or archiving your current code
you are working on where things are commented out
regards
Stefan
I've archived the code per your comments. I programmed around the old loop but the memory problem is still there. It should compile fine in it's archived state with 6169 Longs free.
To reproduce the problem, uncomment the line:
PUB TransmitData·· '' Transmits one data package form 255,0,d,d,d,d,checksum
··· 'ser.tx(Temp, 2)· ' <<<<<<<<<<<<<
Try this line
In HumanInterface_v1.4.
This causes it to go over by 2 longs on my attempts.
Jim-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
cj asked "while the graphics demo takes so little graphics demo 1500 longs of code and 226 longs of variables vs. terminal 1200 of code and 3500 for variables
just wondering why."
here is Chip's answer.. which is not at all as I remembered it[noparse]:)[/noparse]
"The graphics_demo actually took a lot more, but you didn't see it in the compiler's bar graph because it was not reserved using VAR statements. Instead, it used a _stack directive to reserve a big chunk of RAM biased from the end of memory ($7FFF downward):
CON
_stack = ($3000 + $3000 + 100) >> 2 'accomodate display memory and stack
The $3000's are for the display buffers (in bytes). One of the $3000's is for the working bitmap, and the other $3000 is for the display bitmap, so the image is double-buffered, making it flicker-free. The $100 is for the initial COG's stack space. These all get shifted right by 2 (>>2) to get the equivalent long count."
You are out of memory!
With 2 image buffers you have only 8 kByte left for all your objects.
The only way around this is to use a single image buffer.
See this thread for an example: http://forums.parallax.com/showthread.php?p=673946
Andy
cheers!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
I quit this threat.
For me there is too less cooperation from cannibal.
To me it seems he did the last posting in a hurry up and forgot to attach the new and COMPLETELY archived code
including the file PWMSerial.SPIN
If somebody else has more patience - try it
Stefan
Post Edited (StefanL38) : 10/17/2008 10:39:23 PM GMT
I remember running into exactly the same problem... and accidentally stumbled across the right answer the first time.
But when you get multiple answers... and you have already formed an idea about it ... it isn't so easy sometimes.
I don't see much difference between this thread and a hundred others... when you don't get something ... you don't get it.
And when you get multiple answers, you might not see the right one... English might not be your first language... there might be kids screaming
in the next room... etc. etc. etc
Rich
It is amazing to see how quickly guys go from where they are to where they want to go. Many of the questions you see posted have been discussed many times... that alone frustrates many of the guys.
rich
In any case, thanks for all of the help.
Jim-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."