Difference between revisions of "LlSetMemoryLimit"

From Second Life Wiki
Jump to: navigation, search
m (added date of release)
Line 3: Line 3:
|func_desc=Request {{LSLP|limit}} bytes to be reserved for this script.
|func_desc=Request {{LSLP|limit}} bytes to be reserved for this script.
|Return_text=[[TRUE]] or [[FALSE]] indicating if the memory limit was set.
|Return_text=[[TRUE]] if the memory limit was successfully set (or [[FALSE]] if not).

Revision as of 02:04, 4 January 2014


Function: integer llSetMemoryLimit( integer limit );

Request limit bytes to be reserved for this script.
Returns the boolean (an integer) TRUE if the memory limit was successfully set (or FALSE if not).

• integer limit


This function's behavior is dependent upon the VM the script is using. Mono is the new VM, LSO is the old VM.

Sets the memory limit for the script.
  • The memory limit can be set up to 64k.
  • The memory limit can not be set lower than the memory currently in use by the script.
  • All new scripts start with a limit of 64k
  • All existing scripts have a limit of 64k
  • A lower limit will effect the amount of memory reported in the viewer UI and by llGetObjectDetails.
  • The memory limit is not the amount of real memory actually used by the script, just the upper limit on it.
Has no effect on LSO scripts which will always use exactly 16k


When n is too small, llSetMemoryLimit(n) is ignored and the memory limit is not changed
All Issues ~ Search JIRA for related Bugs


<lsl> // Memory-walkthrough by Daemonika Nightfire (daemonika.nightfire)

integer limit = 20000; // <- bytes

Test() {

   llSetText("Limited Memory " + (string)llGetMemoryLimit() +
             "\nUsed Memory " + (string)llGetUsedMemory() +
             "\nFree Memory " + (string)llGetFreeMemory(),<1,1,1>,1);


default {

       llSay(0,"This script used at most " + (string)llGetSPMaxMemory() + " bytes of memory during Test.");


// Result:

// Floating Text: // Limited Memory 20000 // Used Memory 4972 // Free Memory 15100

// Chat: // [05:11] Object: This script used at most 4972 bytes of memory during Test.


Deep Notes


Date of Release 10/08/2011

Search JIRA for related Issues


function integer llSetMemoryLimit( integer limit );