Skip to content

Allow clients to get process ram usage and left amount of ram with functions #1563

@Shuubaru

Description

@Shuubaru

Is your feature request related to a problem? Please describe.
In servers with a really big amount of mods (vehicles, objects, etc) it's really common to crash due to the excessive amount of ram usage. From my tests, when GTA SA ram usage is over 3Gbs it becomes really unstable and tends to crash when attempt to load a file with engine() functions. I have also seen that if you run out of ram you will get a warn in the debug and engine functions will fail to execute, but you cannot check if the function failed since if you include it into another function, the error will stop the execution of that function.

Describe the solution you'd like
There are two features I'd like to see in MTA:
1.- Alert in debug if your PC is about to run out of ram, or if GTA SA ram usage is over 2Gbs (or 2.5).
2.- Allow clients to get left ram and ram usage, with functions like getProcessRamUsage() and getFreeRamAmount() (just an example name) , so, scripters will be able to tell players to disable some mods if, for example, there is a mod loader, or simply prevent from loading a mod if player have no enough ram, or if he is using more than certain amount of ram already.

Describe alternatives you've considered
Making a table with the size of every mod you have in the server would be a good option. But with this you can't calculate the amount of ram the client will have on, for example, 1 hour later.

Additional context

  • This is probably a solution for servers that are using mod loaders, we can prevent crashes by only preventing players to enable more mods that they can handle. Currently it's possible to get the amount of free VRAM and even VRAM usage with dxGetStatus , so, a similar option with RAM will be awesome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions