Get the maximum memory a script can use.

Syntax

integer llGetMemoryLimit();

Forced delay: 0.0 seconds. Energy: ???.

Return value

Returns an integer amount of memory the script can use in bytes.

Specification

Mono
Gets the memory limit for the script.
LSO
LSO scripts will always use exactly 16k

Examples

default
{
    state_entry()
    {
        llSetMemoryLimit( 4000 ); // set the memory limit
        
        // display memory usage...
        llSay(0, "Memory used: " + (string)llGetFreeMemory() + " bytes, total memory: " + 
            (string)llGetMemoryLimit() + " bytes." );
    }
}

// outputs 
// Object: Memory used: 124 bytes, total memory: 4000 bytes.

See also

Functions

Deep notes

History

Date of Release 10/08/2011

Footnotes

  1. Prior to scripts being able to set their own limit, the limit was set to 64k