Page 1 of 1

[FIXED] System.OutOfMemoryException

Posted: Tue Nov 17, 2020 10:56 am
by morphin
Hi
I'm playing a very large scenario and i get often System.OutOfMemoryException messages in the exeption.log

I have 32GB Memory and Ryzen 9 3900X and Command.exe does not use more than about 2GB (Max is 2750MB i measured)

11/17/2020 2:50:54 PM -- B1147.14 -- Exception of type 'System.OutOfMemoryException' was thrown.
Exception: Exception of type 'System.OutOfMemoryException' was thrown.
Stack Trace: at System.Text.StringBuilder.ExpandByABlock(Int32 minBlockCharCount)
at System.Text.StringBuilder.Append(Char* value, Int32 valueCount)
at System.Text.StringBuilder.AppendHelper(String value)
at System.Text.StringBuilder.Append(String value)
at Command_Core.FuelRec.()
at Command_Core.Ship.(XmlWriter& , HashSet`1& )
at Command_Core.Scenario.(XmlWriter )
at Command_Core.Scenario.(Stream , Boolean )
at Command_Core.GameGeneral.(Scenario )
at Command_Core.ScenContainer.()
at Command_Core.ScenContainer.(String theFileName, Boolean PreserveOriginalTimestamps)
at ..(Scenario theScen, Side theCurrentSide, String thePath, Boolean SBR, Boolean MarkAsCampaignCheckpoint)
Call Stack & Error details:
Error at 101005,
Error at 100761,
Error at 101022,
Error at 101087,

RE: System.OutOfMemoryException

Posted: Wed Nov 18, 2020 11:15 am
by morphin
I hope you find a solution. After a few minutes of gaming (a few seconds of gametime). the first errors are logged in the exception.log. After that shortly there is not possible to save the game and later it crashes.

Thank's
Andy

RE: System.OutOfMemoryException

Posted: Wed Nov 18, 2020 1:17 pm
by morphin
I See in the log that Stringbuilder is maybe throwing this error:

So maybe this is a solution to consider?

https://stackoverflow.com/questions/541 ... llion-char

Thank's

RE: System.OutOfMemoryException

Posted: Thu Nov 19, 2020 3:04 am
by Rory Noonan
Logged for investigation.

0014262

Re: [Logged] System.OutOfMemoryException

Posted: Tue Apr 26, 2022 4:06 pm
by Dimitris
Is this still a problem?

Re: [Logged] System.OutOfMemoryException

Posted: Wed Apr 27, 2022 10:24 am
by morphin
Dimitris wrote: Tue Apr 26, 2022 4:06 pm Is this still a problem?
I run run it for 10 seconds without any errors (latest Version 1147.45). Thank's for resolving it :-)

Re: [Logged] System.OutOfMemoryException

Posted: Wed Apr 27, 2022 4:57 pm
by Dimitris
Thanks, closing.