I seen this error encountered on 2 cases
1) Happens when you allocated too much memory with data structures and forgot to free your ds. run the task manage and see if your game accumulates memory, the error happens around 1.6 GB of allocation and may take some time to reach that point during the course of running the program.
Check if you ds_XXX_create without freeing things.
It can also happen with using arrays. to free an array set the variable that holds it to 0
2) It's actually the GPU that ran out of space either for the (2A) textures or for the (2B) render buffer... Usually the error reported is more distinguishable as a gpu memory problem, but I have seen it reported misleadingly as a simple memory error. if that is your problem the crash would be (almost) instantaneous and the task manage would not show a lot of memory used.
-2A
- See if you surface_create() without calling surface_free() when done.
- See if you can reduce the texture page size in the game setting
2B
-You can split the render buffer by calling d3d_transform_set_identity() to split the draw batch, for example. if you have a loop that draws a ton of images or vertices, or if you have a loop that build a huge model, you may need to break it apart so each part draw before you run out of buffer space