Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Recompile vs Reset

Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
05-07-2007 02:06
On the Tools menu there are two options: Recompile Scripts in Selection, and Reset Scripts in Selection.

Recently, I've been having issues with the dreaded Stack Heap Collision and - although it's very difficult to reproduce - I'm more and more coming to the opinion that simply resetting a script does not free all of the possible memory, whereas recompiling does.

I'm pretty sure I've getting the situation where, following a Stack Heap Collision, resetting the script leaves the script in a state where the Stack Heap Collision soon follows. But recompiling the script makes the script functional again. These cases are where the exact same steps are followed after the recompile/reset.

Does resetting a script not fully reinitialise it? Is there a practical difference between recompiling and resetting?
Ultralite Soleil
Registered User
Join date: 31 Aug 2006
Posts: 108
05-07-2007 07:55
From: Pale Spectre
Does resetting a script not fully reinitialise it? Is there a practical difference between recompiling and resetting?

From everything I've seen, the reset that happens during a recompile is the same reset that happens when you click the Reset Script button, and is also the same reset that happens when you call llResetScript. However, if the script has changed such that is uses memory in a different way, recompiling it could definitely cause different memory behavior.

Sounds like you might have to split up your script into multiple scripts and use llMessageLinked to communicate. It's not so bad if your script is splittable along logical divisions.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-07-2007 09:17
Yes, Reset clears all memory allocation for a script back to te same initial state every time.

No, Recompile won't make any difference unless the script has changed (which it should already be recompiled as part of the Save function), or the compiler/interpreter has changed.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
05-07-2007 09:48
I tend to agree with the replies but I'm sure I'm encountering a situation where a script, when used after reset, can be immediately crashed with a Stack-Heap Collision, but when the same script is recompiled it no longer crashes (until it's been further used - but that's a different story). It is, however, very difficult to reproduce the original Stack-Heap Collision and subsequent weirdness.

And, yes, the script is on the margins of memory but unfortunately there are no obvious or simple divisions.