Skip to content
lsl.devlsl.devLSL Dev

llGetMemoryLimit

function
Function syntax
integer llGetMemoryLimit();
Returns
integer
Energy
10

Returns an integer representing the maximum memory limit (in bytes) that the script is allowed to allocate.

Get the maximum memory a script can use.

How to use
integer result = llGetMemoryLimit();

;Mono:Gets the memory limit for the script.

  • The memory limit can be up to 64k.
  • The default memory limit is 64k1.
  • The memory limit is not the amount of real memory actually used by the script, just the upper limit on how much it could use.

;LSO:LSO scripts will always use exactly 16k

Example 1
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.

Date of Release 10/08/2011

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from LlGetMemoryLimit, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.

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