Fractal Softworks Forum

Starsector => Bug Reports & Support => Topic started by: Blaze on November 15, 2014, 09:40:08 AM

Title: Constant Save Corruption [Mods]
Post by: Blaze on November 15, 2014, 09:40:08 AM
I've only been able to play any given save for about 4-6 hours total before I can't load it anymore.

I'm pretty sure it's due to running out of memory (Due to Starsector+ and addons). To help compensate, I've reduced the maximum number of economic fleets, but it still doesn't help too much. I'm using an ancient laptop with only 4gb memory (The game is set to 1024, so I *think* I can safely up it to 2048, but I want to try other ways of reducing usage first.).

Is there any way I can further reduce save file size? I haven't been able to find the maximum number of patrol fleets/detachments, which are pretty huge and probably take up tons of memory. Will using unzipped saves perhaps help in some manner?
Title: Re: Constant Save Corruption
Post by: Midnight Kitsune on November 15, 2014, 09:46:44 AM
Have you tried exiting the game, restarting and then trying your saves?
Title: Re: Constant Save Corruption
Post by: Blaze on November 15, 2014, 09:50:18 AM
Yep.

Console says Java heap error, out of memory. I'm fairly certain it wouldn't do much.
Title: Re: Constant Save Corruption
Post by: Alex on November 15, 2014, 10:30:04 AM
Hi - take a look at this thread:
http://fractalsoftworks.com/forum/index.php?topic=8690.0

It's basically the same issue, but with information on how to resolve it.


In the next (0.65.2a) release, the game will use roughly 2x less memory for saving/loading, which should help with this. Still, with enough mods enabled, there are going to be problems - that's not something that can be fully resolved, only the ceiling raised.

(Also: edited thread title to say [Mods], b/c the initial title freaked me out :))
Title: Re: Constant Save Corruption [Mods]
Post by: Blaze on November 15, 2014, 11:39:49 AM
Bah, the batch file doesn't recognize the mods and attempting to edit vmparams to use 2048m or 2g instead of 1024m causes the exe to not work at all.
Title: Re: Constant Save Corruption [Mods]
Post by: Alex on November 15, 2014, 12:00:34 PM
... attempting to edit vmparams to use 2048m or 2g instead of 1024m causes the exe to not work at all.

Hmm. Two possible causes here: 1) not having replaced the game's Java with 64-bit, using the instructions in the other thread or 2) a typo in vmparams :)
Title: Re: Constant Save Corruption [Mods]
Post by: TimeDiver on November 15, 2014, 12:40:36 PM
Bah, the batch file doesn't recognize the mods and attempting to edit vmparams to use 2048m or 2g instead of 1024m causes the exe to not work at all.

If you, like me are stuck with 32-bit Java due to having a 32-bit operating system installed (yeah, we're a dying breed)...

I've found that the highest memory allocation that allows some, but not all (modded) saves that won't load with the default parameters as of 0.65.1a, is either 1408m or 1472m.

Anything higher than that either crashes Starsector during the initial asset loading/script compilation phase, or the loader itself refuses to, well... even load up at all.

For example, any saves that have Starsector+, the Knights Templar, and its prerequisites of Lazy/ShaderLib(s) installed with the default config settings for said mods, have a increasingly higher tendency to fail to load over time (especially as additional 'integrated' mods are added to the mix) even with said 1408m/1472m memory allocations.

Also, for the Knights Templar mod in particular: its crusade(s) event spawns a shitton of fleets for both that faction when said event kicks off, as well as those of vanilla SS and SS+'s 'integrated' factions, such as Shadowyards, Mayorate, Citadel, Interstellar Imperium, and so on.

Opening up the KT mod's own settings.json and decreasing the 'crusadeScale' value to say, 0.5 or less, or alternatively (or even both), increasing the 'crusadeAverageFrequency' to a much larger value, can possibly serve as a stopgap measure until 0.65.2a shows up. Or just not enable the Knights Templar for campaigns.

Although it should be noted that my version of Windows 7 has had the following parameter set via the command prompt (to allow more than 2 GB to be allocated to any single program):

bcdedit /set IncreaseUserVa 3072
Title: Re: Constant Save Corruption [Mods]
Post by: Tartiflette on November 15, 2014, 12:45:54 PM
Also, you may have only 0.65a and not updated to 0.65.1a. That caused the mods not to be recognized with the .bat
Title: Re: Constant Save Corruption [Mods]
Post by: Lord Sputnik on November 15, 2014, 03:30:23 PM
My saves are getting corrupted every single time I quit the game.  Even saves that worked just fine and were not touched get corrupted.  I've double-checked this and it will even happen if I save right after starting a new game.  I've had to restart a few good games I've had going but it shouldn't be doing this every single time I quit. This is the log file.

Spoiler
Code
719180 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 4
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 5
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 6
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Error loading
719181 [Thread-5] ERROR com.fs.starfarer.campaign.save.CampaignGameManager  - com.fs.starfarer.util.H cannot be cast to java.util.zip.ZipInputStream
java.lang.ClassCastException: com.fs.starfarer.util.H cannot be cast to java.util.zip.ZipInputStream
at com.fs.starfarer.campaign.save.CampaignGameManager.o00000(Unknown Source)
at com.fs.starfarer.title.B.dialogDismissed(Unknown Source)
at com.fs.starfarer.ui.oO0O.dismiss(Unknown Source)
at com.fs.starfarer.ui.impl.J.dismiss(Unknown Source)
at com.fs.starfarer.campaign.save.LoadGameDialog.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.thisnew.super(Unknown Source)
at com.fs.starfarer.ui.null.processInput(Unknown Source)
at com.fs.starfarer.ui.O0Oo.o00000(Unknown Source)
at com.fs.starfarer.B.void.class$super(Unknown Source)
at com.fs.A.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Ò00000(Unknown Source)
at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 11
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 12
719182 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 13
719182 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 14
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading progress: 0.97507495
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Releasing context
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Released context
719186 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 15
719186 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 16
719212 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 17
719212 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 18
719213 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 19
719213 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 20
[close]
Title: Re: Constant Save Corruption [Mods]
Post by: Alex on November 15, 2014, 03:32:05 PM
My saves are getting corrupted every single time I quit the game.  Even saves that worked just fine and were not touched get corrupted.  I've double-checked this and it will even happen if I save right after starting a new game.  I've had to restart a few good games I've had going but it shouldn't be doing this every single time I quit. This is the log file.

Spoiler
Code
719180 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 4
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 5
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 6
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Error loading
719181 [Thread-5] ERROR com.fs.starfarer.campaign.save.CampaignGameManager  - com.fs.starfarer.util.H cannot be cast to java.util.zip.ZipInputStream
java.lang.ClassCastException: com.fs.starfarer.util.H cannot be cast to java.util.zip.ZipInputStream
at com.fs.starfarer.campaign.save.CampaignGameManager.o00000(Unknown Source)
at com.fs.starfarer.title.B.dialogDismissed(Unknown Source)
at com.fs.starfarer.ui.oO0O.dismiss(Unknown Source)
at com.fs.starfarer.ui.impl.J.dismiss(Unknown Source)
at com.fs.starfarer.campaign.save.LoadGameDialog.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.thisnew.super(Unknown Source)
at com.fs.starfarer.ui.null.processInput(Unknown Source)
at com.fs.starfarer.ui.O0Oo.o00000(Unknown Source)
at com.fs.starfarer.B.void.class$super(Unknown Source)
at com.fs.A.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Ò00000(Unknown Source)
at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 11
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 12
719182 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 13
719182 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 14
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading progress: 0.97507495
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Releasing context
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Released context
719186 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 15
719186 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 16
719212 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 17
719212 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 18
719213 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 19
719213 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 20
[close]

Looks like you've disabled save file compression. There's a bug where that doesn't work, it's fixed for  0.65.2a. For now, just turn save compression back on.
Title: Re: Constant Save Corruption [Mods]
Post by: Lord Sputnik on November 15, 2014, 03:41:26 PM
Ah thanks, yeah, I forgot I copied over some settings from 0.63.  For some reason the installer doesn't overwrite it so moving my 0.65 and 0.63 to separate folders and doing a fresh install works now!
Title: Re: Constant Save Corruption [Mods]
Post by: Debido on November 15, 2014, 04:41:47 PM

Although it should be noted that my version of Windows 7 has had the following parameter set via the command prompt (to allow more than 2 GB to be allocated to any single program):

bcdedit /set IncreaseUserVa 3072

Ah...I should know about that one, good catch on that one. I had heard about windows reserving the upper 2GB, for user virtual memory, didn't know it was editable. Could be useful for some.
Title: Re: Constant Save Corruption [Mods]
Post by: Histidine on November 15, 2014, 06:54:15 PM
Couple of quick notes on issues with raising -Xmx:

1) See my thread here (http://fractalsoftworks.com/forum/index.php?topic=8671.0)

2) The Java heap space requires a contiguous block of memory, so if Starsector won't start after raising the value, try things like closing browser windows to free up RAM.