• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM Memory Use

kupo15

Member
Probably still will have the 1.5GB limit. As the IDE is 32 bit also.

GMS2 is 64 bit, so (in theory) your limit will be 2 TB.
Say what? Is GMS2 really 64bit? Does that mean you can have up to 2TB of memory in assets built in the IDE and swap out to VRAM what you need during the game and never have to worry about external loading like you do in GM1.4?
 
T

The Sentient

Guest
Say what? Is GMS2 really 64bit? Does that mean you can have up to 2TB of memory in assets built in the IDE and swap out to VRAM what you need during the game and never have to worry about external loading like you do in GM1.4?
GMS2 only comes in 64 bit (IDE that is).

It depends on what export you use as to whether you can compile your game as 64 bit though. From memory, only UWP supports that presently (unless things have changed in recent months).
 

kupo15

Member
GMS2 only comes in 64 bit (IDE that is).

It depends on what export you use as to whether you can compile your game as 64 bit though. From memory, only UWP supports that presently (unless things have changed in recent months).
Interesting, I thought I read a while back GMS2 was not going to be 64 bit due to compatibility issues, guess not. But even though the IDE and UWP can support up to a 2TB limit, its not like you can really use all of it right? Putting in say 10 GB of memory in the IDE would still crash for people who's cpu only has 6GB of ram?
 
T

The Sentient

Guest
Interesting, I thought I read a while back GMS2 was not going to be 64 bit due to compatibility issues, guess not. But even though the IDE and UWP can support up to a 2TB limit, its not like you can really use all of it right? Putting in say 10 GB of memory in the IDE would still crash for people who's cpu only has 6GB of ram?
GMS2 has and was always going to be 64 bit. You can't get it in 32 bit.


Putting in say 10 GB of memory in the IDE would still crash for people who's cpu only has 6GB of ram?
Well, that happens with any program. Can't fill up a cup that as already full, can you? :p
 

kupo15

Member
Well, that happens with any program. Can't fill up a cup that as already full, can you? :p
Hence your (in theory) bit haha Got it! That was foolish thinking of me! Guess I still got to figure out this external loading using external texture atlas generators :p
 
T

The Sentient

Guest
Hence your (in theory) bit haha Got it! That was foolish thinking of me! Guess I still got to figure out this external loading using external texture atlas generators :p
Yeah, your problem seems to be more to do with the end build (along with you using 1.4 - a 32 bit IDE). Whereas the OP is having problems in the IDE.
 

kupo15

Member
Yeah, your problem seems to be more to do with the end build (along with you using 1.4 - a 32 bit IDE). Whereas the OP is having problems in the IDE.
Yeah, I have no idea if I'll hit that 1.7GB cap 1.4 has or not but trying to be proactive. I don't think I'll be better off with GMS2 helping me out with this issue. Forcing myself to work through my own external solution and keeping memory usage below 1.7GB is probably a good idea anyway for compatibility. I don't think I'll ever need close to 1.7GB of memory at one time anyway so I think it can be done in 1.4
 
T

The Sentient

Guest
Just remember. The runner often keeps a copy of the assets both RAM and VRAM. So, when you think you are only using 850 MB, you might really be using up to that 1.7 GB.
 

kupo15

Member
Fair enough. But that sounds a little dangerous to me. Especially once your programs go public and you don't know how it will affect peoples systems.

As far as your original question, this is all unrelated (compilation ability and compile times). The discussion got derailed a bit with Kupo's question.
My baad! :p This is good info anyway though :)

Just remember. The runner often keeps a copy of the assets both RAM and VRAM. So, when you think you are only using 850 MB, you might really be using up to that 1.7 GB.
Hmm, I don't think this is exactly correct. I could be wrong but I believe when GM copies from RAM to VRAM that copied memory gets used up by the vram and not added to the main ram. I remember monitoring my memory usage (yes via task manager so maybe not quite the best) when I was externally loading things before in 8.1 and I was able to go up to 1.7gb from the task manager reading. I wasn't limited to 800mb

Mike Dailly mentioned it when I was a member of the previous forums.

Think about it though. When a game loses it's textures and geometry as a result of a 'lost device' (i.e. Alt/Tab etc.) the assets have to come from somewhere ;)

I'll see if I can find the post for you.

In the meantime, this depicts what is going on.

The following screenshot is from the link below;



https://forum.yoyogames.com/index.php?threads/vram-101.17801/#post-113782

If you rely on Task Manager to measure the total RAM usage, you are in trouble ;)
He probably mentioned in one of my previous memory posts haha I'll see if I can find it. That thread you linked to said that the task manager measures RAM which is what the OP was asking about, why exactly is the task manager a bad way to view total ram usage?
 
T

The Sentient

Guest
Hmm, I don't think this is exactly correct. I could be wrong but I believe when GM copies from RAM to VRAM that copied memory gets used up by the vram and not added to the main ram. I remember monitoring my memory usage (yes via task manager so maybe not quite the best) when I was externally loading things before in 8.1 and I was able to go up to 1.7gb from the task manager reading. I wasn't limited to 800mb
Ever wondered why you have never been able to reach the 32 bit limit? (2 GB) ;)

why exactly is the task manager a bad way to view total ram usage?
It only shows system RAM usage not VRAM usage.

Apparently the 'Windows Insider' build will do this. But presently in the standard Windows builds - no.

 
Last edited by a moderator:

GMWolf

aka fel666
Well, that happens with any program. Can't fill up a cup that as already full, can you? :p
You can by making the cup larger.
The OS will do some paging.
Essentially moving chunks of ram onto the drive, freeing up sokme memory. When that chunk is needed again it's moved back onto ram. Needless to say this is slow, but allows for much more memory.
Windows will also do some funky stuff like compressing data on ram.
 
T

The Sentient

Guest
You can by making the cup larger.
The OS will do some paging.
Essentially moving chunks of ram onto the drive, freeing up sokme memory. When that chunk is needed again it's moved back onto ram. Needless to say this is slow, but allows for much more memory.
Windows will also do some funky stuff like compressing data on ram.
System RAM for sure. Which is fine regarding the question for the OP.

As far as Kupo's question goes. Absolutely not. You can't using paging memory on the GPU. For two reasons;

1) It can't be done. :p
2) It would be excessively slow. Look at GPU RAM access speeds when compared to HDD transfer rates. Frame rates would be in the order of 1 per minute on complex games.
 

GMWolf

aka fel666
System RAM for sure. Which is fine regarding the question for the OP.

As far as Kupo's question goes. Absolutely not. You can't using paging memory on the GPU. For two reasons;

1) It can't be done. :p
2) It would be excessively slow. Look at GPU RAM access speeds when compared to HDD transfer rates. Frame rates would be in the order of 1 per minute on complex games.
kupo was asking about GPU?
He only mentioned ram and CPU.
 
T

The Sentient

Guest
kupo was asking about GPU?
He only mentioned ram and CPU.
Kupo's game is very heavily reliant on GPU RAM, so I thought it went without saying.

No way you'll take up 1.7 GB of game logic on a fighter game.
 

kupo15

Member
Ever wondered why you have never been able to reach the 32 bit limit? (2 GB) ;)



It only shows system RAM usage not VRAM usage.

Apparently the 'Windows Insider' build will do this. But presently in the standard Windows builds - no.
Hold up haha I was going to say "wait so you are saying that the 1.7gb limit REALLY is a combination of system ram and gpu vram combined?" Then I saw your last post and got more confused :p

Kupo's game is very heavily reliant on GPU RAM, so I thought it went without saying.

No way you'll take up 1.7 GB of game logic on a fighter game.
Yup I'm primarily concerned with Gpu ram, however are you saying that RAM is only used up for game logic and not anything graphically? Like game logic and code uses up ram only and graphic resources use up vram only?

Am I wrong in my thinking that RAM is used for anything that gets compiled into the game (as in your resources and everything in the game needs to take up less than 1.7gb before compile to even work) and the VRAM from the gpu is an extension or additional memory available to you? (that only handles graphics though)

To be clear, I don't mean 1.7gb RAM from the 32 bit program+a 4gb vram GPU = 5.7gb at your disposal.

Rather, with a 1.7gb ram (due to 32bit) limits you to 1.7gb of vram?

Essentially I thought that the ram and vram are two cups. Ram being the first cup and it simply pours its water (I know it actually copies) into the second cup, the vram.

Seriously, Yoyo games could really use a tech blog dedicated to this topic :/
 

GMWolf

aka fel666
Speaking out side of GM
Textures are usually kept in ram in case of device lost, etc. This allows them to be quickly re-loaded into ram. (Imagine having to load them from disk everytime!)

I suspect GM does this too. (it makes sense after all).

On the Vram side of things, textures will usually spill out onto the ram or be loaded into vram every frame, reducing performance. (That is, if each of the textures are used every frame. remember to flush your textures!)
 
T

The Sentient

Guest
Hold up haha I was going to say "wait so you are saying that the 1.7gb limit REALLY is a combination of system ram and gpu vram combined?" Then I saw your last post and got more confused :p

Yup I'm primarily concerned with Gpu ram, however are you saying that RAM is only used up for game logic and not anything graphically? Like game logic and code uses up ram only and graphic resources use up vram only?
No, I was just saying to fel666 that system RAM holds a combination of logic and assets and then you have whatever is in VRAM also.

1.7GB isn't the limit as such 2.0 is. But there will be VRAM things going on (invisible to you) which pushes you over that 2.0GB limit. Just depends on how the game is structured.

In an older project of mine 800 MB system RAM was the upper limit for me as there was a lot going on on the GPU which pushed it over he 2GB limit. So, 1.7GB isn't a 'hard limit'. This will vary between projects.


Speaking out side of GM
Textures are usually kept in ram in case of device lost, etc. This allows them to be quickly re-loaded into ram. (Imagine having to load them from disk everytime!)

I suspect GM does this too. (it makes sense after all).

On the Vram side of things, textures will usually spill out onto the ram or be loaded into vram every frame, reducing performance. (That is, if each of the textures are used every frame. remember to flush your textures!)
That's exactly the point I was trying to make earlier. There are copies all over the place. This is where Task Manager is evil as you don't get the full picture.
 

kupo15

Member
On the Vram side of things, textures will usually spill out onto the ram or be loaded into vram every frame, reducing performance. (That is, if each of the textures are used every frame. remember to flush your textures!)
Is this why the task manager memory increases when you load graphics into vram? Vram spills back out into ram? I would think that if the task manager only shows ram and not vram that this number shouldn't change when loading in and flushing out vram yet it does

No, I was just saying to fel666 that system RAM holds a combination of logic and assets and then you have whatever is in VRAM also.

1.7GB isn't the limit as such 2.0 is. But there will be VRAM things going on (invisible to you) which pushes you over that 2.0GB limit. Just depends on how the game is structured.

In an older project of mine 800 MB system RAM was the upper limit for me as there was a lot going on on the GPU which pushed it over he 2GB limit. So, 1.7GB isn't a 'hard limit'. This will vary between projects.




That's exactly the point I was trying to make earlier. There are copies all over the place. This is where Task Manager is evil as you don't get the full picture.
Dang ok I get it now I think. I thought your Graphics Card held its own memory to handle graphics because of the varying number of GB Ram they come with, as in as long as the game compiles and you don't load into vram more memory than the graphics card can hold you are good. So is the difference between a gtx 1060 3gb and 6gb that the 6gb can process up to 6gb of graphic memory at one time?

Is the only reason why you say the task manager is evil is because it doesn't show vram usage and that if it did then it would be fine?
 
T

The Sentient

Guest
Yep. Task manager only shows system RAM usage.

Is this why the task manager memory increases when you load graphics into vram? Vram spills back out into ram? I would think that if the task manager only shows ram and not vram that this number shouldn't change when loading in and flushing out vram yet it does
Sort of. There is a copy in system RAM for 'lost devices', i.e. Alt/Tabbing etc.

When the device is 'lost' it will quickly copy the assets from RAM back into VRAM.

So if you had 250 MB of assets in RAM that were immediately required on device reset then suddenly your total RAM usage (VRAM + RAM) becomes 500 MB.
 

GMWolf

aka fel666
Ok, so thsdepends on a few things.
Here i will assume a PC with a dedicated graphics card.
The vram and ram are separate. The vram is a chip on the graphics card, the ram is on your motherboard.

When you load a texture, it is first loaded into ram, and then passed to the GPU (put in VRAM).
Becuase its not uncommon for the gpu to loose textures, textures are often kept on the ram, so that if the gpu looses it, it can be quickly reloaded onto the GPU.

If you go over the vram size, then a couple things can happen, but usually the memory gets cleared to make more space and the textures have to be loaded onto the gpu again. (There is also some interesting things like ram being used as vram but i'm not too fammiliar with this stuff).

However not all your textures are loaded. GM will only load a texture the first time you use it (or if you orefetch it). It will also unload them if you run out of memory (or if you flush them). This means that you should be ok if you have many large sprites, but only use a couple of them at a time. (Make sure you prefetch and flush and the start /end of a level. You wouldnt want to freeze the game because you are loading the psrite for your super conbo animation).


As for IGPUs on lowend machines and consoles? Well here the ram is shared. So textures are all in ram and nothing needs to be copied. This can actually lead to better performance if you have a lot of textures that would not fit in vram, mainly due to there being no transfer of texture data between ram and vram. But vram is optimized for textures and ram for general computing which is why higher end GPUs just go with more VRAM. Its faster, but coste more.
 
T

The Sentient

Guest
As for IGPUs on lowend machines and consoles? Well here the ram is shared. So textures are all in ram and nothing needs to be copied. This can actually lead to better performance if you have a lot of textures that would not fit in vram, mainly due to there being no transfer of texture data between ram and vram. But vram is optimized for textures and ram for general computing which is why higher end GPUs just go with more VRAM. Its faster, but coste more.
You sure about this one?

As far as I understood it, the system BIOS partitions the system RAM into OS RAM and VRAM. Which means they are effectively different RAM as far as Windows is concerned.

Pretty sure they are not shared as far as the OS goes. Meaning you still have the same effect on RAM usage as a dedicated GFX card.

(Maybe this should be split into its own thread as this has nothing to do with the OP's compile limits question - will ask a mod to look at splitting the topic)
 
Last edited by a moderator:

GMWolf

aka fel666
You sure about this one?

As far as I understood it, the system BIOS partitions the system RAM into OS RAM and VRAM. Which means they are effectively different RAM as far as Windows is concerned.

Pretty sure they are not shared as far as the OS goes. Meaning you still have the same effect on RAM usage as a dedicated GFX card.

(Maybe this should be split into its own thread as this has nothing to do with the OP's compile limits question - will ask a mod to look at splitting the topic)
Hmmm. Yeah. For an IGpu on PC the ram is split. Still you have much greater band with than over the PCIe interface. (Largely offset by the performance of vram and dedicated hardware).

But on consoles Its totally shared. A source of great joy for hackers.


... but don't quote me on that... better to ask someone who actually works with console hardware
 
Top