-
-
Couldn't load subscription status.
- Fork 496
Description
Describe the bug
This issue is related to the use of custom maps combined with the functions
createBuilding and engineStreamingFreeUpMemory tonumber(200) * 1024 * 1024.
Note: The
engineStreamingFreeUpMemoryfunction appears to have no practical effect. There are no usage examples in the documentation, and in testing it didn’t produce any noticeable results.
The function
engineStreamingSetMemorySize (tonumber(32) * 1024 * 1024)
was also tested and showed inconsistent behavior:
- In some cases, small values allow a modified map to load normally, while in others, the same values cause the loading to fail.
- Very high values cause the game to assume that models don’t need to be unloaded from memory, which quickly leads to excessive RAM usage. This occurs on both original and custom maps.
- Lower than recommended values (64MB, 32MB, 16MB, or even 8MB) can still load the map, although objects may eventually disappear, which is expected.
During testing, the original map unloads almost immediately with low values, whereas custom maps can remain stable and functional for much longer under the same conditions.
The analysis was done using
engineStreamingGetModelLoadState, which reports the load state of each model.

With low stream memory values, the number of loaded models stays between 400 and 500, dynamically switching to “Unloaded” when needed.
At 512MB of stream memory, the game holds far more models in memory, resulting in higher and more constant RAM usage, with little to no memory being freed over time.
Observed results:
-
8MB stream memory
- The tested resource (411MB) keeps total memory usage between 900MB and 1GB.
- Memory usage gradually decreases over time, sometimes dropping to around 800MB.
-
16MB stream memory
- On modified maps: works fine, map loads and streams properly.
- On the original map: severe streaming and loading issues occur. (expected)
-
512MB stream memory
- Memory usage remains constant between 1.3GB and 1.5GB with no fluctuation.
- Models stop being unloaded, causing memory to fill up continuously.
Request:
-
Improve the official documentation for these functions, especially with practical examples for use in custom maps.
-
Investigate potential inconsistencies in the
engineStreamingSetMemorySizebehavior:- On original maps, low values cause expected popping or unloading issues.
- On custom maps, low values sometimes work unexpectedly well.
- High values prevent models from being released from memory, leading to rapid memory saturation in both cases.
Steps to reproduce
-
Load a custom map in MTA (you can use Liberty City or Vice City from Eagle Loader).
-
Set the streaming memory using the
engineStreamingSetMemorySizefunction with different values (for example, 8MB, 16MB, 32MB, or 512MB). -
Observe the map’s behavior while moving around:
- With low values, the custom map usually continues to work, but some objects may occasionally disappear.
- With low values on the original map, the map may disappear immediately or show popping.
- With very high values, RAM usage rapidly increases because the game does not unload loaded models.
-
Use the
engineStreamingGetModelLoadStatefunction to monitor the model states. You will see that the number of loaded models increases as you move around the map, until it reaches the maximum limit. -
Compare the behavior between original and custom maps, and across different
engineStreamingSetMemorySizevalues.
Version
I test in:
Multi Theft Auto v1.6-release-23528
and
Multi Theft Auto v1.6-release-23324...
Additional context
No response
Relevant log output
Security Policy
- I have read and understood the Security Policy and this issue is not security related.