Difference between revisions of "LlGetMemoryLimit"

From Second Life Wiki
Jump to navigation Jump to search
m (Undo revision 1155189 by Digit Ditko (Talk) Why? This function doesn't have a link parameter.)
m
 
(4 intermediate revisions by 3 users not shown)
Line 10: Line 10:
;Mono:Gets the memory limit for the script.
;Mono:Gets the memory limit for the script.
* The memory limit can be up to 64k.
* The memory limit can be up to 64k.
* All new scripts start with a limit of 64k
* The default memory limit is 64k{{Footnote|Prior to scripts being able to set their own limit, the limit was set to 64k}}.
* All existing scripts have a limit of 64k
* 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.
* The memory limit is not the amount of real memory actually used by the script, just the upper limit on it.


;LSO:LSO scripts will always use exactly 16k
;LSO:LSO scripts will always use exactly 16k


|helpers
|helpers
|examples=<source lang="lsl2">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.</source>
|also_functions=
|also_functions=
{{LSL DefineRow||[[llSetMemoryLimit]]|}}
{{LSL DefineRow||[[llSetMemoryLimit]]|}}
Line 26: Line 39:
|also_articles
|also_articles
|notes
|notes
|history=*Scheduled for [[Beta/Magnum|RC Magnum]] channel, week of August 3, 2011.
|lso
|lso
|cat1=Script
|cat1=Script
Line 32: Line 44:
|cat3=Script Profiler
|cat3=Script Profiler
|cat4
|cat4
|history = Date of Release  [[ Release_Notes/Second_Life_Server/11#11.08.10.238207 | 10/08/2011 ]]
}}
}}

Latest revision as of 02:14, 22 January 2015

Summary

Function: integer llGetMemoryLimit( );

Get the maximum memory a script can use.
Returns the integer amount of memory the script can use in bytes.

Specification

Mono
Gets the memory limit for the script.
  • The memory limit can be up to 64k.
  • The default memory limit is 64k[1].
  • 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

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

Deep Notes

History

Date of Release 10/08/2011
Search JIRA for related Issues

Footnotes

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

Signature

function integer llGetMemoryLimit();