Page 1 of 1

[0.16.20] Random crash on startup if CPU usage is high

Posted: Wed Jan 31, 2018 6:01 pm
by migulis
This bug happens during startup at 40% "cropping bitmaps."

If CPU usage is high (mining cryptocurrency...) when launching the game, it sometimes crashes at 40%. Error messages change from crash to crash. Sometimes it is "Could not create atlas bitmap size(xx,xx), probably not enough video memory", sometimes just "Unexpected error." Steam also usually crashes (no error, just closes) when this happens.
Originally I thought that it had something to do with gpu mining, but this still sometimes happens when it is off, and all of the 4 (3.5) gb of VRAM is free. Due to randomnes of this happening, I was unable to test if this also happens with other kind of CPU load, than crypto mining. This also is not strictly 0.16.20 crash, this has happened before on older .16.x builds.

Re: [0.16.20] Random crash on startup if CPU usage is high

Posted: Wed Jan 31, 2018 6:33 pm
by Rseding91
Thanks for the report. It's crashing running out of memory trying to allocate a 3.3 MB buffer to load an image from disk.

Most likely your mining software is taking up a large amount of RAM and then trying to load high res sprites is taking up even more to the point of exhaustion.

You can try turning off parallel sprite loading which will reduce the amount of RAM the game wants at startup by changing the config.ini line "thread-sprite-loading" to false. (also be sure to un-comment it).

Re: [0.16.20] Random crash on startup if CPU usage is high

Posted: Wed Jan 31, 2018 8:03 pm
by migulis
I should have mentioned that I have 10gb free ram when the crash occurs, so it is not about running out of it.
Maybe something does not happen as fast as some other thread expects and it causes a problem?

Re: [0.16.20] Random crash on startup if CPU usage is high

Posted: Wed Jan 31, 2018 8:22 pm
by Rseding91
migulis wrote:I should have mentioned that I have 10gb free ram when the crash occurs, so it is not about running out of it.
Maybe something does not happen as fast as some other thread expects and it causes a problem?
It crashed failing to allocate memory which is 100% an "out of memory" issue regardless of what you see in task manager at the time of it happening.