EngineStreamingFreeUpMemory: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:
addEventHandler ("onClientResourceStart", resourceRoot,
addEventHandler ("onClientResourceStart", resourceRoot,
     function ()
     function ()
         engineStreamingFreeUpMemory (100000000) -- 100 megabytes
         engineStreamingFreeUpMemory (104857600) -- 100 megabytes
     end
     end
)
)

Revision as of 01:15, 23 September 2021

20901

[[{{{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
)

Requirements

This template will be deleted.

See Also