• 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!

Legacy GM Some players get out of memory when start game?

saga55555

Member
Hi, I create my game demo and share it to many players. Most of the players can play it without problem but some player can't play the demo. When they open the game. They got white screen and long load. Then crash by out of memory in the end.

Game using 300MB memory while playing. When CG scene, game will load external images and using 800MB - 1GB memory but it's will load only on CG room. What can caused this out of memory when start game? or it's that player PC problem?

And I want to asking about texture page. GMS always load all use and unuse texture pages at start game. Are there a way to load specific texture pages at beginning of stage and use draw_texture_flush with load texture from demand checked? Load on demand will cause game lag when loading new assets.
And isn't GMS has max memory at 1.7GB? Why my game always crash when around 1.1-1.2GB?

Thank you :D
 
Last edited:
K

kirkkaf13

Guest
You can use sprite_add() to load images into memory prior to the room generating. Remember to use sprite_delete() once you are finished with the resources. Sorry I cannot answer anymore of your questions as I am new to GM myself.
 

saga55555

Member
You can use sprite_add() to load images into memory prior to the room generating. Remember to use sprite_delete() once you are finished with the resources. Sorry I cannot answer anymore of your questions as I am new to GM myself.
Thank for the answer but I already use sprite_add in my game. Sprite add use lot of memory, it's take around 1 GB in my game CG room.
So I consider that in the end when my game is finished. the memory that running game maybe nearly 1 GB without sprite_add.
So I cannot load more external sprites in to memory because out of memory issue.

I created game in GM8 before by using spite_add and sprite_delete with 1.7GB max memory.
but now in GMS I got out of memory error when memory more than more than 1.3GB -*-
 
K

kirkkaf13

Guest
Unfortunately I do not know the limitations of GMS someone with more experience will hopefully assist.
 

saga55555

Member
One of tester give this error log to me
Code:
Faulting application name: AG - Tia.exe, version: 1.0.0.14, time stamp: 0x57f65875
Faulting module name: AG - Tia.exe, version: 1.0.0.14, time stamp: 0x57f65875
Exception code: 0xc0000005
Fault offset: 0x000be517
Faulting process id: 0x850
Faulting application start time: 0x01d2327bc95cf032
He said game run without using memory more than 400MB

I'm not sure it's same problem as out of memory when start game or not.
I really need help here >.<"
 
Last edited:

Bingdom

Googledom
That's a very large amount of RAM usage. Some quality 3D games don't even use that much.

My recommendation is to find out what's eating all of your RAM. Make sure data structures are destroyed when no longer in use, and no continuous generation of external sprites.

room_restart and game_restart seem to create a memory leak, make sure you don't use them often, or at all. ;)
 

saga55555

Member
That's a very large amount of RAM usage. Some quality 3D games don't even use that much.

My recommendation is to find out what's eating all of your RAM. Make sure data structures are destroyed when no longer in use, and no continuous generation of external sprites.

room_restart and game_restart seem to create a memory leak, make sure you don't use them often, or at all. ;)
Thank for reply :D
My game use 300+ pixel height with lot of frames. So it's can't be help.
For CG animation that use sprite_add and using ton of memory. Maybe I will learn to use Spine runtime.

And nope my game doesn't have any memory leak. The start game and out of memory is happen "only some players".
So I want to know what caused it? Because my game demo run at 300-400MB. So even with 2GB RAM PC shouldn't have problem to start the game.

And is GMS fully supported Windows10?
Are players need to use dedicated graphic card to run game?
 
Last edited:
A

Arjailer

Guest
Out of memory errors will be thrown the first time it can't allocate a requested chunk of memory. Requested amounts of memory must be available as contiguous free memory, but memory can become fragmented as you allocate and destroy objects (just like a hard-drive becomes fragmented as you create and delete files) so, for example it's possible after creating and destroyed many objects to have 500MB "free", but be unable to allocate a 100MB chunk (because that 500Mb could be made up of lots of small gaps in the memory space, with none of them big enough to fit a continuous 100MB chunk).

In a system that manages the memory automatically (e.g. GM) there's not a lot you can do about this other than just not using large objects.

More info: https://blogs.msdn.microsoft.com/er...-of-memory-does-not-refer-to-physical-memory/ - as it says "An “out of memory” error almost never happens because there’s not enough storage available ... Rather, an “out of memory” error happens because the process is unable to find a large enough section of contiguous unused pages in its virtual address space to do the requested mapping."

Can't explain the differences between GM8 and GM:S though (only been using GM:S about a month).
 
A

anomalous

Guest
I'm curious what this looked like in the debugger. Did you see a memory spike much higher than 300MB at load?
My game is not extravagant and runs at 200mb, and if that's a an issue, good lord.
 
A

Arjailer

Guest
I don't think it's the "300MB memory while playing" part that's the problem, it's the "when CG scene, game will load external images and using 800MB - 1GB memory" that's causing the crash as "my game always crash when around 1.1-1.2GB".
 

saga55555

Member
I don't think it's the "300MB memory while playing" part that's the problem, it's the "when CG scene, game will load external images and using 800MB - 1GB memory" that's causing the crash as "my game always crash when around 1.1-1.2GB".
I don't think the problem come from CG because CG will load in to memory only in CG room by sprite_add and delete after room end.
But players get white screen when open game and after a minute get "out of memory"

Game run around 430MB when start and 315MB after loaded.

I try to collect player PC info (some players who can't start game) :
- Windows 10 64bit, integrated graphics card with 8gb RAM
- Windows 10 64bit, Graphic card: Nvidia Quadro fx 4600, 4GB RAM
- And other players told me that most of them use "integrated graphic card"

And one of the player who get "out of memory" when start game told me that he can fixed it by set sleep margin to 0 and texture on demand to 1.

So is integrated graphic card can be a culprit here? Are there way I can fix or do on my side?
And how to config that sleep margin to 0 and texture on demand to 1? Graphic card setting?


THANKS :D
 
Last edited:
A

anomalous

Guest
Out of curiosity, what size, and how many texture pages do you have?
 

John Andrews

Living Enigma
Hi, I create my game demo and share it to many players. Most of the players can play it without problem but some player can't play the demo. When they open the game. They got white screen and long load. Then crash by out of memory in the end.

Game using 300MB memory while playing. When CG scene, game will load external images and using 800MB - 1GB memory but it's will load only on CG room. What can caused this out of memory when start game? or it's that player PC problem?

And I want to asking about texture page. GMS always load all use and unuse texture pages at start game. Are there a way to load specific texture pages at beginning of stage and use draw_texture_flush with load texture from demand checked? Load on demand will cause game lag when loading new assets.
And isn't GMS has max memory at 1.7GB? Why my game always crash when around 1.1-1.2GB?

Thank you :D
My eyes are bleeding ;-;
 
A

anomalous

Guest
That's a lot of texture pages. Do you use texture groups or is it just random what sprites are on which texture page?
If it tries to load them all at once, perhaps that could be an issue for crappy graphics cards.
 

saga55555

Member
That's a lot of texture pages. Do you use texture groups or is it just random what sprites are on which texture page?
If it tries to load them all at once, perhaps that could be an issue for crappy graphics cards.
It's separate by texture group.
But still all texture pages load when start game on windows anyway -*-

And now I found a way to fix it but it's come up with new question.
I send game with install application instead of exe runtime. After install, game folder will have "options.ini" and player can turn on/off "Create texture on demand".
When Create texture on demand is ON. Players who got out of memory when start can play the game *-*

The question is "How to make options.ini same as install application for single runtime EXE?" So players who have problem with out of memory can turn it ON by themself.
And Turn OFF for players who don't have problem. They can play game without load while playing. THANKS :D
 

Carolusclen

Member
for loading options depending on the player, you could just have a radial button on the main menu that when it is enabled, it turns on a variable

Code:
load_options = 0

if (load_options = 1)
{
    // change tha game settings here from the options file
    load_options = 0
}

something like that
 

saga55555

Member
for loading options depending on the player, you could just have a radial button on the main menu that when it is enabled, it turns on a variable

Code:
load_options = 0

if (load_options = 1)
{
    // change tha game settings here from the options file
    load_options = 0
}
something like that
Thank but how can I enable Create Textures on Demand for exe version? What code?
And it's should enable or disable before game load textures.

Something like I set create texture on demand enable as default. When open game, program will open .ini file.
Then if ini file read CreateTexturesonDemand=0. Then [do code] and It's will disable CreateTexturesonDemand and load all texture pages?
 

Carolusclen

Member
Thank but how can I enable Create Textures on Demand for exe version? What code?
And it's should enable or disable before game load textures.

Something like I set create texture on demand enable as default. When open game, program will open .ini file.
Then if ini file read CreateTexturesonDemand=0. Then [do code] and It's will disable CreateTexturesonDemand and load all texture pages?

you are going to have to have the exe version read a settings ini on startup before anything else.
get it to read weather it should or shouldn't load the textures.

you will need the code that reads from your options file to run at game startup, probably create a room that runs first with the code then goes to the next room after

this may help, its the only thing i could find
https://docs.yoyogames.com/source/dadiospice/001_advanced use/global game settings/windows tab.html

EDIT: looking at that i think you may need to have 2 exe's, one with it enabled and one without. read the article and you will know what i mean :)

search the page for "demand"
 

saga55555

Member
you are going to have to have the exe version read a settings ini on startup before anything else.
get it to read weather it should or shouldn't load the textures.

you will need the code that reads from your options file to run at game startup, probably create a room that runs first with the code then goes to the next room after

this may help, its the only thing i could find
https://docs.yoyogames.com/source/dadiospice/001_advanced use/global game settings/windows tab.html

EDIT: looking at that i think you may need to have 2 exe's, one with it enabled and one without. read the article and you will know what i mean :)

search the page for "demand"
Thank you
OH! no way to customize without installer? Or separate EXE?
This is a bad news to me -*-
 
Top