engineStreamingSetMemorySize | Multi Theft Auto: Wiki Skip to content

engineStreamingSetMemorySize

Client-side
Server-side
Shared

Pair: engineStreamingGetMemorySize

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


Sets the maximum amount of RAM [in bytes] that can be used for streaming

Tip

The showmemstat command can be used to see this value in real-time [You might have to scroll down using PgDown on your keyboard]

Tip

To restore to default value use engineStreamingRestoreMemorySize

Important

This function is meant for advanced users only, as it can lead to stability issues . Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in [and due to the way MTA works micro-stutter as well]

OOP Syntax Help! I don't understand this!

Syntax

nil engineStreamingSetMemorySize ( int sizeBytes )
Required Arguments
  • sizeBytes: The maximum amount of RAM [in bytes] that can be used for streaming. Must be a positive non-zero number.

Returns

  • nil: value

Code Examples

shared

This example adds a command that can be used to change the streaming memory size, and display the previous value.

addCommandHandler("ssms", function(_, sizeMB)
if tonumber(sizeMB) then
outputChatBox("The maximum streaming memory available has been changed from " .. math.floor(engineStreamingGetMemorySize() / 1024 / 1024) .. " MB to " .. sizeMB .. " MB")
engineStreamingSetMemorySize(tonumber(sizeMB) * 1024 * 1024) -- Convert MB to Bytes
else
outputChatBox("Please enter a numeric value!")
end
end, false, false)

See Also

Engine Functions
Engine Elements