I recently ran through a really long game of survival (675k woohoo!). I had left it running by itself for some time, and when I came back and checked on the progress my computer was acting sluggish and odd. I checked the CPU and memory usage of GSB, and found that it was using 1.1 gigs of memory. This is quite different than the 35 megs or so it uses when I first start the game
The battle lasted a very long time, and in addition it was probably sitting in the defeat screen for a few hours on top of that. I posted my score and went back to the main menu, opened a challenge, but the game locked up at some point around then. It would seem that the memory used during the survival battle was never freed back to the system.
Sounds like it actually is a horrid memory leak. One thing I never anticiopated was survival modes going that long. For one thing, I don’t think I clean up the space hulks drifting around at any stage. I shall have to look into what it could be.
Its not a hardware thing, I’m just obviously letting something build up over time. I never thought a game would last this long, but that’s no excuse. I’ll find it at some point.
I obviously can’t see your code, but my first guess would be the space hulks…
I know you can turn the display of space hulks off in the options, but does this stop the game from creating them in memory? If this is the case, a time to live on the hulks could fix the problem easily
I’m hurt!
turning off hulks means they are never even considered, or created at any point. It’s interesting to hear that turning them off doesnt stop the leak though. I suspect it may be statistics related. Every single shot that is fired is logged as an in-game stat. After four hours, that must build up…
Actually, if anyone here has a fleet that can last ages on survival, and triggers a memory leak, can they email me the deployment text file? and any associated ship designs too. Otherwise, I may end up designing a fleet that doesn’t do it somehow, and waste hours waiting for it to happen. I’m cliff@positech.co.uk
Cheers
yes it does. Unfortunately I can’t work out yet what it is. It looks like its not anything obvious. I suspect its something actually within the non-game code, that I don’t realise is allocating anything.
bah! I’m still working on it, and its already eld me to find a way to speed up some code that’s unrelated