Page 1 of 1

[2.0.10] Crash on launch, out of memory errors

Posted: Fri Oct 25, 2024 1:15 am
by grillgamesh
Bug Information:
Upon fresh launch from a freshly booted PC after updating from steam, I was greeted with a "base mod" error (henceforth referred to as "Error 1".
I then relaunched the game, and was greetd with a "Failed creating a texture" (Henceforth referred to as "Error 2";
WIN+SHIFT+S would not allow me to capture a direct screenshot, as it would restart my graphics driver (presumably, at least... it's the same behavior as pressing WIN+CTRL+SHIFT+B. so something graphical happens I guess)

After 3 relaunches to confirm behvaior, all files were validated by steam. Steam then showed that gamefiles were all valid, and no corruption was present.

Steps to Reproduce:
Freshly rebooted Windows 10 desktop
Launch steam, and after updating to latest version of 2.0.10, you would be greeted with Error 1.
Relaunch game, and you will be greeted with Error 2.
Upon relaunch, Error 2 rears its head again, and prevents the game from launching. Several relaunches have shown that Error 2 will subsequently always happen after Error 1.

Logs:
factorio-current, and factorio-previous logs are attached.
Note that error 1 is not present in the logs, due to the logs not saving beyond 2 launches, and I relaunched several times.

Error 2 appears to be `D3D11_ERROR: ID3D11Device::CreateTexture2D failed in createInternalTexture on line 250. Error [0x8007000e] - E_OUTOFMEMORY`, which upon checking taskmgr, shows that I have over 12GB of RAM free, and GPU RAM is also almost completely free. Attached are screenshots of taskmanager showing free RAM for GPU and System.

I think I've gotten all the info, however I will answer any questions you may have.
stuff

Re: [2.0.10 - Steam] Crash Upon Launch - Multiple Errors

Posted: Fri Oct 25, 2024 7:26 pm
by saxnviolence
I am having this same exact problem. Including my current and previous logs as well for posterity.

Re: [2.0.10 - Steam] Crash Upon Launch - Multiple Errors

Posted: Fri Oct 25, 2024 8:58 pm
by Genhis
Thanks for the report. Both of you seem to have run out of memory, but based on the hardware specs this shouldn't be possible. Your page file seems a bit too full, you could try increasing its size.

Re: [2.0.10 - Steam] Crash Upon Launch - Multiple Errors

Posted: Sat Oct 26, 2024 5:14 pm
by grillgamesh
Oddly enough, my pagefile is at 4GB, on an NVMe drive.


logfile attached after I launched today.

Re: [2.0.10] Crash on launch, out of memory errors

Posted: Sat Nov 02, 2024 7:33 am
by grillgamesh
So, it seems to be that factorio writes to the pagefile first; not to RAM.
For some reason, if the pagefile is full (even when set to "system-managed"), even when windows has a substantial amount of VRAM and regular RAM, nothing can be written to RAM.
Not sure if this is a factorio-specific error, or some windows.... well, windows-ism... the internet had multiple threads on this exact issue with other programs, so it may be just some borked legacy layover NT kernel behavior from the time when RAM was lacking, and storage was plentiful... (i've found threads dating as far back as 2005, and some as recent as Early 2020, or Late 2020

For the time being, the solution seems to be:
- fresh boot, always
- open factorio before anything else has a chance to load in
- open any other apps, after factorio loads.

quite annoying, I realize, but it does in fact allow for the texture maps to be created, and the game to launch normally.

There *are* solutions to force factorio to try to write to system RAM before paging, but that requires some code rewrites for the actual executable, and uh... I'm not quite advanced enough to do exe unpacking and recompiling, especially with such a complex executable.

anyhow, here's the latest logs as well.

Re: [2.0.10] Crash on launch, out of memory errors

Posted: Sat Nov 02, 2024 2:25 pm
by Loewchen
grillgamesh wrote: Sat Nov 02, 2024 7:33 am So, it seems to be that factorio writes to the pagefile first; not to RAM.
For some reason, if the pagefile is full (even when set to "system-managed"), even when windows has a substantial amount of VRAM and regular RAM, nothing can be written to RAM.
That is not how factorio works though, that is how operating systems work.

Re: [2.0.10] Crash on launch, out of memory errors

Posted: Sat Nov 02, 2024 7:59 pm
by grillgamesh
Loewchen wrote: Sat Nov 02, 2024 2:25 pm
grillgamesh wrote: Sat Nov 02, 2024 7:33 am So, it seems to be that factorio writes to the pagefile first; not to RAM.
For some reason, if the pagefile is full (even when set to "system-managed"), even when windows has a substantial amount of VRAM and regular RAM, nothing can be written to RAM.
That is not how factorio works though, that is how operating systems work.
true, true; however that's if you're using the OS memory manager, and not an in-house one. and as we all know, M$ memory management is wack. I'd take a WUBE-made memory manager over M$'s any day, lol.
but I digress, i was more making a write up of the stuff I discovered last night as more of a posterity thing for future reference than anything.