EngineStreamingFreeUpMemory: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Remove obsolete Requirements section)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
{{Added feature/item|3.0159|1.5.9|1.5.8|20901|This function frees up the streaming RAM memory.}}
{{Added feature/item|1.5.9|1.5.8|20901|This function frees up the streaming RAM memory.}}
{{Note|This function isn't accurate. The function works more like ''try to free up at least this amount of bytes''. It usually ends up freeing everything that isn't currently needed (which, depending on the scenery might be 1-200 megabytes).}}
{{Note|This function isn't accurate. The function works more like ''try to free up at least this amount of bytes''. It usually ends up freeing everything that isn't currently needed (which, depending on the scenery might be 1-200 megabytes).}}


Line 16: Line 16:
addEventHandler ("onClientResourceStart", resourceRoot,
addEventHandler ("onClientResourceStart", resourceRoot,
     function ()
     function ()
         engineStreamingFreeUpMemory (100000000) -- 100 megabytes
         engineStreamingFreeUpMemory (104857600) -- 100 megabytes
     end
     end
)
)
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|n/a|1.5.8-9.20901|}}


==See Also==
==See Also==
{{Engine_functions}}
{{Engine_functions}}

Latest revision as of 17:28, 7 November 2024

This function frees up the streaming RAM memory.

[[{{{image}}}|link=|]] Note: This function isn't accurate. The function works more like try to free up at least this amount of bytes. It usually ends up freeing everything that isn't currently needed (which, depending on the scenery might be 1-200 megabytes).

Syntax

bool engineStreamingFreeUpMemory ( int bytes )

Required Arguments

  • bytes: The amount of RAM to be freed up in bytes.

Returns

  • Returns true if the function has succeeded, false otherwise.

Example

This example frees up the streaming memory when the resource starts:

addEventHandler ("onClientResourceStart", resourceRoot,
    function ()
        engineStreamingFreeUpMemory (104857600) -- 100 megabytes
    end
)

See Also