Jump to content
You are about to reply to a thread that has been inactive for 1564 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

No, but you can enable the LSL Preprocessor if you're on Firestorm. It adds a comment like this to the source code:

//program_version Firestorm-Releasex64 6.3.2.58052 - Wulfie Reanimator
//last_compiled 06/02/2020 11:13:25

You can find it in Preferences > Firestorm > Build 1 > Enable LSL Preprocessor

Edited by Wulfie Reanimator
Link to comment
Share on other sites

Hi there,

I wrote some example scripts for you, so you can better monitor your memory use.
I hope these examples get you closer to write more efficient code.
Cheers.

V1
==
- displays the target function's memory use.

V2
==
- displays the target function's memory use &
- displays max memory limit.

V2
==
- sets the memory limit
- displays the target function's memory use &
- displays the predefined memory limit.

// V1
// ==
testFunction()
{
    key objOwnerKey   = llGetOwner();
    key objTriggerKey = llDetectedKey(0);
    if (objOwnerKey == objTriggerKey)
    {
        llOwnerSay("owner UUID: " + (string)objOwnerKey);
    }
}

default
{
    touch_end(integer n)
    {
        llScriptProfiler(PROFILE_SCRIPT_MEMORY);
        testFunction();
        llScriptProfiler(PROFILE_NONE);
        llOwnerSay("Memory used: " + (string)llGetSPMaxMemory() + " bytes.");
    }
}

// V2
// ==
testFunction()
{
    key objOwnerKey   = llGetOwner();
    key objTriggerKey = llDetectedKey(0);
    if (objOwnerKey == objTriggerKey)
    {
        llOwnerSay("owner UUID: " + (string)objOwnerKey);
    }
}

default
{
    touch_end(integer n)
    {
        llScriptProfiler(PROFILE_SCRIPT_MEMORY);
        testFunction();
        llScriptProfiler(PROFILE_NONE);
        llOwnerSay("Memory used: " + (string)llGetSPMaxMemory() + " bytes.");
        llOwnerSay("Memory limit: " + (string)llGetMemoryLimit() + " bytes.");
    }
}

// V3
// ==
testFunction()
{
    key objOwnerKey   = llGetOwner();
    key objTriggerKey = llDetectedKey(0);
    if (objOwnerKey == objTriggerKey)
    {
        llOwnerSay("owner UUID: " + (string)objOwnerKey);
    }
}

default
{
    touch_end(integer n)
    {
        llSetMemoryLimit(5000);
        llScriptProfiler(PROFILE_SCRIPT_MEMORY);
        testFunction();
        llScriptProfiler(PROFILE_NONE);
        llOwnerSay("Memory used: " + (string)llGetSPMaxMemory() + " bytes.");
        llOwnerSay("Memory limit: " + (string)llGetMemoryLimit() + " bytes.");
    }
}

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1564 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...