Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Stack/Heap Collision errors

Driftwood Nomad
Registered User
Join date: 10 May 2003
Posts: 451
07-24-2003 01:07
Ok, we need more resources for each script. It seems I run into the stack/heap collision error way too often with a medium sized script that contains a good amount of variables, states, and loops.

I know to avoid list functions due to a memory leak, and I've managed to optimize code so I can have reusable functions to call rather than repeat the code, but I still get this error way too often.

What is the allotted memory per script? I'd rather be able to write one large script that does everything I need rather than be forced to split it up into smaller scripts (unless llSetScriptState is fixed, then having separate scripts would be easier to deal with).

Help!
_____________________
Driftwood Nomad
D&D Dogs Co-founder

"Second Life’s first AI companion animal"
The Second Opinion, 08/05/2003

D&D Dogs HQ Pawaii (127, 63)
Mainland Store Kuula (214, 124)

http://www.sldogs.com

SL Dogs Zazzle store!
si Money
The nice demon.
Join date: 21 May 2003
Posts: 477
Re: Stack/Heap Collision errors
07-24-2003 02:31
From: someone
Originally posted by Driftwood Nomad
Ok, we need more resources for each script. It seems I run into the stack/heap collision error way too often with a medium sized script that contains a good amount of variables, states, and loops.

I know to avoid list functions due to a memory leak, and I've managed to optimize code so I can have reusable functions to call rather than repeat the code, but I still get this error way too often.

What is the allotted memory per script? I'd rather be able to write one large script that does everything I need rather than be forced to split it up into smaller scripts (unless llSetScriptState is fixed, then having separate scripts would be easier to deal with).

Help!


Wow, i've done some pretty ridiculous scripts, and i've never run into this consistently. I had one script which had in order of 35 global variables and didn't have resource issues until I actually did something that broke the syntax parser, and then blew the thing up because I made a mistake in an assignment.

I can't imagine a script which would run into this regularly. Why can't you break it up into more than one script? It's probably more managable that way anyhow
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
07-24-2003 07:06
As everyone should know (;)) I have created many casino type games. Some of these have been extremely complicated, with very long scripts and they do not break.

I wonder to what extremes you are going to if you are running in to this. Or if possibly it isn't something else happening that is causing the errors.

On a related note, my coding practice has of course evolved over time and I have just started splitting my programs into 3 scripts: Accounting, System and Data. I do this not to avoid stack heaps but because Accounting breaks the most often (loss of permissions) and is the exact same for every game I create. Also by seperating the Data from the system I can change the system, update or fix it, without losing any data. And on some projects I have in the works that is *very* important.
Grim Lupis
Dark Wolf
Join date: 11 Jul 2003
Posts: 762
07-24-2003 07:09
Ama, if I may ask a question??

What method do you use to allow your other scripts to retrieve data from the data script? I didn't think scripts could directly access each other. MessageLinked??
_____________________
Grim

"God only made a few perfect heads, the rest of them he put hair on." -- Unknown
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
07-24-2003 09:47
Yes that is what I use. And my use may be unclear. I don't store general variables in the data script. The data script acts like a database, I can ask it for data (from a list or lists) and it will send data back.