Jump to content

A couple questions about memory usage


Decro

Recommended Posts

Hello there, i'm sometimes expecting strange things happening about memory, so i have a few questions about it.

1. How much RAM and video-memory MTA may use? Feel's like there is some limits, cause it's just falls into "NOT ENOUGHT MEMORY" crash even using ~half of it. So i just want to know, how much memory MTA may use without overloading? What's the limits?

2. Is there a way to clean memory used by "dxDrawImage" function? I mean, memory is being used by images even when they are won't being shown.

3. How's MTA works with custom models? Seem's like every single model/texture loads directly into RAM, forever, is there a way to avoid this? Maybe a streamer that kinda unload models from RAM if they are too far away from player, or something?

Edited by Decro
Link to comment

1. There are issues with mta vram/ram management when it comes to graphical components like shaders or textures which may cause them to fail to create even when there's lots of memory still available theoretically.
2. Stuff like dxDrawImage don't stay in memory, they are queued to draw in current frame, and cease to exist afterwards. Textures used by them are stored in memory only.
3. No idea.

Link to comment
2 hours ago, Decro said:

Hello there, i'm sometimes expecting strange things happening about memory, so i have a few questions about it.

1. How much RAM and video-memory MTA may use? Feel's like there is some limits, cause it's just falls into "NOT ENOUGHT MEMORY" crash even using ~half of it. So i just want to know, how much memory MTA may use without overloading? What's the limits?

2. Is there a way to clean memory used by "dxDrawImage" function? I mean, memory is being used by images even when they are won't being shown.

3. How's MTA works with custom models? Seem's like every single model/texture loads directly into RAM, forever, is there a way to avoid this? Maybe a streamer that kinda unload models from RAM if they are too far away from player, or something?

3. Well if you want you could destroy the .DFF;.TXD;.COL elements when they are not streamed. But it's not a good idea.

Link to comment

I can at least answer the last one, from my experience, MTA only loads models into memory that are streamed in, and when they are streamed out they are unloaded. This is evident because when my streamer is running on static and I go to a different part of the map there's a few second load time until all of the models initialize

Edited by CodyJ(L)
Link to comment
  • Scripting Moderators
34 minutes ago, CodyJ(L) said:

I can at least answer the last one, from my experience, MTA only loads models into memory that are streamed in, and when they are streamed out they are unloaded. This is evident because when my streamer is running on static and I go to a different part of the map there's a few second load time until all of the models initialize

Just refer to CLEO.

If you want to create a vehicle, you need to check whether the model is available first, and then load model into memory.

After loading model, you could create a vehicle.

 

But in MTA you don't need to load model when you create an object , a vehicle  or a ped etc. Because this step is done when you call "create*" function such as createObject .

Anyway, if you want to load external dff, txd, col, you can't skip this step.

So we have engineLoad* functions which can be cleared by destroyElement to load external model into memory.

Edited by thisdp
Link to comment

Debugging the cpu and ram usage of my server while it contains many mods and many scripts, certainly not as big as CodyL's server, however it is probably the size of a normal MTA Freeroam server. The ram usage always stays below 1GB, and cpu usage always stays under 10%. I have 4GB's of ram and dual core 3.7GHz cpu dedicated to the server. I have plenty left over to run whatever else I need on the vps, such as a website, database, mail server, what have you. Possibly even another MTA server.


Edited by ShayF
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...