FreeOrion crashes on selecting Load Game

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Message
Author
User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: FreeOrion crashes on selecting Load Game

#16 Post by LienRag »

I had similar error messages (and similar to this one too) to the extent that I stopped playing.

After upgrading my RAM from 6 to 12 Gb I gave it a try with the new stable release, and it worked for a while.
Then I got again similar messages (on a 40 AI opponents and 2000 systems I think) and when I checked htop I saw that it was using all my RAM and also all the 6 Gb swap (I hadn't changed the swap setting after upgrading the RAM).
When I expanded the swap to 12 Gb it worked again, using all RAM + 8 Gb of swap, and after a while it crashed again, then I expanded the swap again to 18 Gb and it worked again (using RAM + 15 Gb of swap, meaning that loading a game took more than one hour), then it started crashing again and I expanded the swap to 24 Gb and it worked again for a while using RAM + 23 Gb then started crashing again and I abandoned it (too bad, I had developed interesting strategies and really wanted to see how they would fare in the long run).

I have no idea if that's only because I tried galaxy settings that were too much for what my RAM and CPU could chew, or if some corruption in the saved game generated an overblown RAM consumption.

I suspect the later since I first reached turn 170 without too much of a strain (yes waiting from one turn to the next took time, as did loading games, but not in the more than hour range) and after understanding that I had been playing carelessly for a while I went back to turn 30 (that I had saved) and after that I began to have trouble (with the same swap as before) around turn 85 and had to abandon the game (after raising my swap to 24 Gb as explained above) around turn 150.

Or maybe it's because after rebooting from turn 30 I played much better (both because I was more careful and because I had more information about the Galaxy around me) and had then more planets conquered/colonized ? I don't know if that would be enough to explain the RAM consumption discrepancies, especially considering that I had killed two more AI in the meantime (dead AI don't consume CPU nor RAM I reckon?).

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: FreeOrion crashes on selecting Load Game

#17 Post by Geoff the Medio »

LienRag wrote: Wed May 13, 2020 5:50 amI have no idea if that's only because I tried galaxy settings that were too much for what my RAM and CPU could chew, or if some corruption in the saved game generated an overblown RAM consumption.
[...]
I don't know if that would be enough to explain the RAM consumption discrepancies, especially considering that I had killed two more AI in the meantime (dead AI don't consume CPU nor RAM I reckon?).
Probably the galaxy was too big, or rather the number of objects in the game universe over time got too large. Defeating an AI doesn't actually do much to lower the server's memory consumption, which is what is limiting the save and load processes, because the game (and specifically empires) remember old gamestate information about previously-existing objects. There is probably a reasonable optimization possible where officially defeated empires will forget all their latest-known-gamestate information, though, in which case defeating them would help memory consumption somewhat. Various other optimizations are also possible within the current save structure, or saves could be reworked to not require as much RAM to compress and decompress, but would then lack human (mostly) readable header information at the start.

That said, did you try switching to binary save files? They should not require as much RAM to save and load.

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: FreeOrion crashes on selecting Load Game

#18 Post by LienRag »

Oh, I didn't know that !
Maybe I'll try binary saves then, thanks.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: FreeOrion crashes on selecting Load Game

#19 Post by Geoff the Medio »

LienRag wrote: Wed May 13, 2020 8:53 amMaybe I'll try binary saves then, thanks.
Specifically: In the options window, turn off autosaves and (in the other tab, I believe) set it to use binary serialization for saves (I forget the exact wording of the option). Then load an existing save that (eventually) loads, even if it takes a long time (this save does not need to be binary format for it to load while binary serialization is enabled). Then save the game manually. If that works reasonably quickly, then you can try turning autosaves back on. Play a few turns, and then try loading one of the new binary-format saves. They should be a substantially different size of file on disk from the compressed XML as well, to verify that they are in the alternate format. You can also try loading a save in a decent text editor (that can handle huge files) and check that the compressed XML format file has a semi-readable text header portion at the start, while the binary format file does not.

Post Reply