The manual for
draw_texture_flush states that "
by default on all targets, texture pages will only be loaded as they are required". (This used to be different - on Windows, everything used to be preloaded, always. Compare to GMS 1 manual.)
When in doubt... let's try it.
I tend to draw as much information as I can find from the manual, but unfortunately, there's a bit of radio silence about the inner workings of this (or I just haven't found the right page yet). So, to not get too far into making assumptions, I'll share my findings here, but please take my analysis as nothing more than considerations of what could be going on under the hood, as I unfortunately don't know that exactly and don't have access to any source for it.
Baseline RAM usage of my test project: 20.8 MB, constant within a few hundred KB
After adding 7 4096x4096 sprites, adding them to an otherwise empty texture group and disabling it being exported to Windows: 33.3 MB (odd, but okay), constant within a few hundred KB
After enabling it being exported to Windows: Roughly same as previous
After placing one of the sprites on an asset layer: 99.9 MB, then 35.3 MB after a while (!), constant within a few hundred KB
After placing the other sprites on the asset layer: Roughly same as previous (???)
Huh.
Memory readings are from Task Manager (active private working set), not the debugger. Shared working set reports 22 MB constantly, for all of the tests above.
Debugger reports memory readings of 6 MB for the baseline and 27 MB once I add a single sprite to the room. Further sprites (not instances of the same sprite, but different sprites altogether) don't increase it.
Unless my math is wrong, a 4096x4096 texture page should take up 64 MB of any memory uncompressed (8 bit per channel, RGBA). This is roughly the increase I see when switching the texture group on, at least for a while. It feels like while stuff
does get loaded into RAM, it only stays there for a brief moment (before being loaded into VRAM and then removed from RAM?). Processes don't necessarily instantly release memory for performance reasons, so this could be why the spike is only the size of a single texture page even though multiple are loaded - any subsequent ones use and overwrite the memory that was allocated for the first.
This is however merely an experiment, as I'm not familiar with the actual inner workings of GM... so take it with a grain of salt.
Full disclosure: I don't have a full understanding of this topic. In fact, it used to confuse the hell out of me. I used to find the manual about this rather unclear, in some places using the term "memory" in a way that doesn't make it fully clear whether it's talking about RAM or VRAM, which confused me a lot when I initially tried to become familiar with the topic of texture pages years ago. The manual seems to be a lot clearer nowadays, and - as far as I can find - explicitly states "video memory" on any pages that have anything to do with loading texture pages.
I initially replied to this topic thinking - drawing from prior experience, or at least what I
thought was what I had experienced in the past - that texture pages are stored both in RAM and VRAM when loaded. This seems to either not be the case anymore, or it has never been the case, although I'm sure that exactly that (texture pages taking up RAM while being loaded) is what many others had problems with and that I helped fix by suggesting them to load their sprites dynamically from external files and only loading the ones that are needed.
According to my experiment, it seems like texture pages are only temporarily loaded into RAM, then loaded into VRAM, then the RAM that was used for this process is freed and, after a while, deallocated. Which blows my mind, to say the least.
This unfortunately doesn't move this topic forward in any way, though, because if my results and conclusions are in any way close to the truth, OP's game should not be loading everything into RAM, but merely the size of one texture page into RAM at most.
I'm unable to find any documentation in the runtime or IDE release notes that says this was recently changed, and I'm now thoroughly confused about how this all really works between what I thought was my past experience and this experiment to the point where I don't trust either of them anymore. The best thing I can suggest at this point is to contact the helpdesk to get it straight from the source (if they are willing to provide this info, that is).