Memory Leak

Crash Player setup Saves & Loading
cw64 [github] · 1 year ago

Issue description

I'm experiencing crashes and failures to save the game on long playthroughs which seem to be related to memory.

I have 8Gb ram. I started playing with no swapfile, and the game would crash frequently. Upon adding a swapfile they happened less frequently. Increasing its size reduced the occurance more.

Loading a second save whilst playing an existing one will either crash immediately or make a crash happen sooner (this has been happening since 2020).

After playing straight for several hours the game will fail to save progress either manually or automatically, and will soon crash after this point. It is sometimes possible to save to a new save file but the game will still crash soon after.

Reproduction steps

Disable swapfile/restrict memory.

Game version and build number

v0.7.8a b486

Operating system

Windows

Attachments

25-08-22_14-40-29_3223.log, 25-08-22_14-43-39_8498.log, 25-08-22_16-35-44_9422.log, 25-08-23_12-48-42_7925.log, 25-08-24_10-33-03_8305.log, 25-08-24_21-43-31_4510.log

Saves won't upload.

Player.log, Player-prev.log

There is a text output error message when saving fails. I'll add it when it happens again.

8 attachments only for registered users
Captain Filip Captain Filip · 1 year ago

Can you please zip your save file and upload it here? Does it happen with everything or specific game session?

Captain Filip Captain Filip · 1 year ago

I think you just don't have enough RAM. Tha game loaded from your map takes 5Gb of RAM, now you also need RAM for your OS and other services. CoI takes more RAM over time as it propagates more caches and saves the history of things you build. We used to have a memory leak that would slowly grow when placing large blueprints around, but that was fixed. We also reduced leaks between game loads; currently, it increases by a small amount, such as ~50 MB but we can't do more there at this point. But we are not aware of an ongoing leak that would cause infinite growth. It is not clear why your game crashes, as you didn't attach player.log, but it must be some instability due to the swapfile.

cw64 [github] · 1 year ago

Recommended ram is 8Gb. Minimum is 4Gb

I should be able to play without crashing. The fact that crashes occur over long periods of time suggest a memory leak or other issue with the engine's ram usage. Especially since loading a second save makes the game crash immediately. That alone makes it certain that the problem is with the game/engine. If it was working correctly loading a second save should be no different to loading the first one on system usage (50MB is not enough for an instant crash). If it's not a memory leak then the game is otherwise tying up more ram than it needs.

If the game crashes after 8 hours of gameplay because the map is too big I should crash 15 minutes after I load up the auto save. This does not happen.

Why have a build history and let it accumulate over time? Get rid of it. The save file is the record of the game state. A history of everything I do in the game is completely useless. It's not lke I can undo changes. Again, get rid of it.

It is not an issue on my side.

cw64 [github] · 1 year ago

All logs present have been attached as per the template. If there are other logs you need to tell me where they are.

poltime poltime · 1 year ago

%AppData%\Captain of Industry\Logs
%USERPROFILE%\AppData\LocalLow\Mafi Games\Captain of Industry
%USERPROFILE%\AppData\Local\Temp\Mafi Games\Captain of Industry\Crashes

cw64 [github] · 1 year ago

%USERPROFILE%\AppData\Local\Temp\Mafi Games\Captain of Industry\Crashes

Windows can not find it. ...\AppData\Local\Temp is empty.

cw64 [github] · 1 year ago

Also the fact that I can sometimes save to a new file but can not save to an existing file means there is more going on here than my ram which again is the recommended amount to play the game.

cw64 [github] · 1 year ago

Pregame launch
Image

Game loaded
Image

Save loaded
Image

~1.5 hours later
Image

~3.5 hours later
Image

It is not a problem with my system.

18 Showing 1–10 of 10