Page 1 of 1
Memory allocation crash on save, corrupts save file
Posted: Wed Sep 30, 2020 7:52 pm
by _white_
Hello,
I suddenly started having an issue where both manual and auto saves result in a crash most of the time, the save file is created but its corrupted due to the game never being able to finish the save. A working save is 117MB, judging by how sudden this issue is I'd guess I have reached a point where the game is having issues writing the stream into the file. It is gamebreaking at the moment as I can never know whether the next save will go through or simply crash.
https://easyupload.io/lkxi2a
Re: Memory allocation crash on save, corrupts save file
Posted: Thu Oct 01, 2020 4:21 am
by David
Could you please post a large version of the screenshot? It is too small and I cannot see the error message clearly.
And when I attempted to download your save game file, I got an "access denied" error.
Re: Memory allocation crash on save, corrupts save file
Posted: Thu Oct 01, 2020 6:03 am
by _white_
The screenshot looks normal to me, reuploaded it here:
https://imgur.com/a/ABR7bTr
As for the save file it is also accessible for me, but i reupped it here (had to cut the file into two due to the size):
https://file.io/EOlXFf1oLbBC
https://file.io/BqBNxWUpX1y7
Let me know please if these are still broken, successfully uploading large files is a pain
Re: Memory allocation crash on save, corrupts save file
Posted: Thu Oct 01, 2020 8:44 am
by David
I was able to download your save game file and view the error message with the latest links you provided. The error message indicates that your game has so much data that when the game was saving your game, it was unable to allocate memory it required for the file compression function to compress your game data. (The game uses a file compression function to compress the raw game data before it saves to a savegame file.) In your case, the memory the memory compression function required is a block of free memory of approximately 160MB, as indicated by the error message.
Closing other Windows applications while running the game will help. Giving your Windows a reset and run the game after the reset will also help. And when you start your next game from scratch, I would recommend that you reduce the number of cities from 10 to 7 or lower, so that it will use less memory.
Re: Memory allocation crash on save, corrupts save file
Posted: Thu Oct 01, 2020 9:18 am
by _white_
I have 32GB of RAM so there was definitely enough system memory available, is this a limitation with the memory the process can allocate to itself?
Re: Memory allocation crash on save, corrupts save file
Posted: Thu Oct 01, 2020 9:47 am
by David
It could be due to Memory fragmentation. The error message tells that the game needs to allocate a single, continuous block of memory of 160MB. There is a possibility that the memory of your computer has become fragmented and is unable to supply a single memory block of 160MB.
For your information:
Memory fragmentation is when most of your memory is allocated in a large number of non-contiguous blocks, or chunks - leaving a good percentage of your total memory unallocated, but unusable for most typical scenarios. This results in out of memory exceptions, or allocation errors (i.e. malloc returns null).
The suggestions I wrote in my previous posts should help mitigate it:
Closing other Windows applications while running the game will help. Giving your Windows a reset and run the game after the reset will also help. And when you start your next game from scratch, I would recommend that you reduce the number of cities from 10 to 7 or lower, so that it will use less memory.
Re: Memory allocation crash on save, corrupts save file
Posted: Thu Oct 01, 2020 9:55 am
by paulwoman
Just for your information:
There was a time when I had bugs galore in the game.
A good part of it was solved by putting back an old image created by acronis true image, which is similar to doing a "clean" windows installation.
Re: Memory allocation crash on save, corrupts save file
Posted: Mon Oct 05, 2020 7:26 am
by _white_
I gave the same game a test on a cleaner environment, and while initially it worked great, the error began to creep back in after a few hours which is in line with the memory fragmentation idea, but still somewhat questionable due to the amount of total memory I have an that no other application has ever had such an issue before.
David, would it be possible to catch this error and add a "Failed to save game" or similar popup, so we can try to save again instead of crashing and losing progress?
Re: Memory allocation crash on save, corrupts save file
Posted: Mon Oct 05, 2020 12:25 pm
by David
I've sent you a test version of the game via PM (private messaging).